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
When updating the virtual property of Combobox, useIsoMorphicEffect is called with a dispatch call to ActionTypes.UpdateVirtualOptions. This reducer dispatch updates the internal virtual reference using Object.assign({}, state.virtual, { options: action.options }) which notably does not include the virtual.disabled property, effectively setting it to undefined which then throws a P.disabled is not a function error when ComboboxOptions is rendered.
In the example provided, the initial state is to not be virtualized. The list renders as expected. Toggling into a virtualized list causes the aforementioned bug to trigger and you get the described error.
Likewise, if you start the demo off with a virtualized state, the list renders as expected (virtualized). Toggling the state to not virtualized causes a different error where it is attempting to call the render prop of the virtualized ComboboxOptions component. I believe this is caused by the same Object.assign reducer call in that when the incoming virtual object is undefined, it is still setting a virtual state with an empty options property. This causes the user component to render the un-virtualized component while the internal state of the Combobox is still reflecting a virtualized list.
The text was updated successfully, but these errors were encountered:
What package within Headless UI are you using?
For example: @headlessui/react
What version of that package are you using?
v2.0.3
What browser are you using?
Chrome Version 124.0.6367.209 (Official Build) (arm64)
Reproduction URL
https://codesandbox.io/p/devbox/kind-meitner-xwk2gg?file=%2Fsrc%2FApp.jsx
Describe your issue
When updating the
virtual
property ofCombobox
,useIsoMorphicEffect
is called with adispatch
call toActionTypes.UpdateVirtualOptions
. This reducer dispatch updates the internalvirtual
reference usingObject.assign({}, state.virtual, { options: action.options })
which notably does not include thevirtual.disabled
property, effectively setting it toundefined
which then throws aP.disabled is not a function
error whenComboboxOptions
is rendered.In the example provided, the initial state is to not be virtualized. The list renders as expected. Toggling into a virtualized list causes the aforementioned bug to trigger and you get the described error.
Likewise, if you start the demo off with a virtualized state, the list renders as expected (virtualized). Toggling the state to not virtualized causes a different error where it is attempting to call the render prop of the virtualized
ComboboxOptions
component. I believe this is caused by the sameObject.assign
reducer call in that when the incomingvirtual
object isundefined
, it is still setting avirtual
state with an empty options property. This causes the user component to render the un-virtualized component while the internal state of theCombobox
is still reflecting a virtualized list.The text was updated successfully, but these errors were encountered: