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
I'm making use of Listbox components in a new application and ran into what seems to be a bug with the resetting of uncontrolled Listbox components. It works perfectly unless multiple is enabled, in which case the uncontrolled form reset breaks everything.
I cloned down the repo to make use of some existing tests and received the following results when enabling multiple in the uncontrolled Listbox reset tests:
Listbox default value: defaultValue={['bob']}
Value after "alice" is selected: [ 'bob', 'alice' ]
Value passed to onChange event when reset is triggered: [ 'bob' ] (the default value)
Value after reset completes: [ 'bob', 'alice', [ 'bob' ] ]
Am I using the default value incorrectly or is this a legitimate bug?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all!
I'm making use of Listbox components in a new application and ran into what seems to be a bug with the resetting of uncontrolled Listbox components. It works perfectly unless
multiple
is enabled, in which case the uncontrolled form reset breaks everything.I cloned down the repo to make use of some existing tests and received the following results when enabling multiple in the uncontrolled Listbox reset tests:
Listbox default value:
defaultValue={['bob']}
Value after "alice" is selected:
[ 'bob', 'alice' ]
Value passed to
onChange
event when reset is triggered:[ 'bob' ]
(the default value)Value after reset completes:
[ 'bob', 'alice', [ 'bob' ] ]
Am I using the default value incorrectly or is this a legitimate bug?
NOTE: I'm using headlessui-react
Beta Was this translation helpful? Give feedback.
All reactions