Combobox Component doesn't recognize preset value if collection is only loaded after #1948
mrchrishahn
started this conversation in
General
Replies: 1 comment 3 replies
-
Could you share a reproduction and I can suggest a more appropriate way to handle it? I imagine setting the inputValue instead of value could help mitigate this. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've been trying to pin down a pesky bug recently where forms where we were using the combobox as a field that loads options from the server wouldn't display the preselected value.
The situation was as follows:
value
of the combobox from the existing state (but not the list of options) - we'd pass this through the value propinputValue
- users had to manually select that valueI believe the issue lies in how when the collection is set, the function to check for a matching selected value isn't triggered.
zag/packages/machines/combobox/src/combobox.machine.ts
Lines 888 to 890 in 2ddd37a
I worked around it for now by delaying the passing of the
value
to only once the data has loaded - kinda hacky but works for the meantimeBeta Was this translation helpful? Give feedback.
All reactions