Render virtual items during an exiting transition (#3160)

Otherwise the render function will get called with different options by `render()` resulting in undefined
This commit is contained in:
Jordan Pittman
2024-05-01 09:14:49 -04:00
committed by GitHub
parent cb1abe42e6
commit 2e6cb126ef
@@ -1659,7 +1659,7 @@ function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(
})
// 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: <VirtualProvider>{theirProps.children}</VirtualProvider>,