You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure refs are forwarded when freezing data (#3390)
We were wrapping rendered children in `<Frozen>` in a combobox however
the refs weren't being forwarded through the internal `<Frozen>`
component resulting in issues when rendering `<ComboboxOptions>` as a
`Fragment`.
After this PR the following code no longer warns about function
components not accepting refs.
```tsx
import { Combobox, ComboboxInput, ComboboxOption, ComboboxOptions } from '@headlessui/react'
import React from 'react'
export default function Example() {
return (
<div className="p-4">
<Combobox>
<ComboboxInput className="rounded border border-neutral-400 p-2" />
<ComboboxOptions as={React.Fragment}>
<div className="bg-orange-500 p-4">
<ComboboxOption value="a">A</ComboboxOption>
</div>
</ComboboxOptions>
</Combobox>
</div>
)
}
```
Fixes#3384
---------
Co-authored-by: Robin Malfait <[email protected]>
Copy file name to clipboardExpand all lines: packages/@headlessui-react/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
- Allow home/end key default behavior inside `ComboboxInput` when `Combobox` is closed ([#3798](https://github.com/tailwindlabs/headlessui/pull/3798))
17
17
- Ensure interacting with a `Dialog` on iOS works after interacting with a disallowed area ([#3801](https://github.com/tailwindlabs/headlessui/pull/3801))
18
18
- Freeze Listbox values as soon as possible when closing ([#3802](https://github.com/tailwindlabs/headlessui/pull/3802))
19
+
- Ensure refs are forwarded when freezing data ([#3390](https://github.com/tailwindlabs/headlessui/pull/3390))
0 commit comments