From 2e6cb126efe74b8e43985a7b8a0dd9accaefdc0e Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 1 May 2024 09:14:49 -0400 Subject: [PATCH] Render virtual items during an exiting transition (#3160) Otherwise the render function will get called with different options by `render()` resulting in undefined --- packages/@headlessui-react/src/components/combobox/combobox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@headlessui-react/src/components/combobox/combobox.tsx b/packages/@headlessui-react/src/components/combobox/combobox.tsx index 832dff3..c1a09c4 100644 --- a/packages/@headlessui-react/src/components/combobox/combobox.tsx +++ b/packages/@headlessui-react/src/components/combobox/combobox.tsx @@ -1659,7 +1659,7 @@ function OptionsFn( }) // Map the children in a scrollable container when virtualization is enabled - if (data.virtual && data.comboboxState === ComboboxState.Open) { + if (data.virtual && visible) { Object.assign(theirProps, { // @ts-expect-error The `children` prop now is a callback function that receives `{ option }`. children: {theirProps.children},