Skip to content

Commit 2e6cb12

Browse files
Render virtual items during an exiting transition (#3160)
Otherwise the render function will get called with different options by `render()` resulting in undefined
1 parent cb1abe4 commit 2e6cb12

File tree

1 file changed

+1
-1
lines changed
  • packages/@headlessui-react/src/components/combobox

1 file changed

+1
-1
lines changed

packages/@headlessui-react/src/components/combobox/combobox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(
16591659
})
16601660

16611661
// Map the children in a scrollable container when virtualization is enabled
1662-
if (data.virtual && data.comboboxState === ComboboxState.Open) {
1662+
if (data.virtual && visible) {
16631663
Object.assign(theirProps, {
16641664
// @ts-expect-error The `children` prop now is a callback function that receives `{ option }`.
16651665
children: <VirtualProvider>{theirProps.children}</VirtualProvider>,

0 commit comments

Comments
 (0)