Combobox: ComboboxOption value ID with ComboboxInput displayValue not working as expected #1632
Unanswered
kskrlinnorth2
asked this question in
Help
Replies: 1 comment
-
This... is very big issue if someone wants to use the combobox as an uncontrolled input. 99% of the time the value needs to be an id but the displayValue should be something like the name.. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What package within Headless UI are you using?
@headlessui/vue
What version of that package are you using?
v1.6.5
What browser are you using?
Chrome
Describe your issue
If I want to show in
ComboboxInput
user name viadisplayValue
then I must setvalue
inComboboxOption
to user object, however this saves v-model value as that object, and not ID. Since option values are usually either IDs or simple keys, and not full objects how to setup code to use ID as option value , but in the same time name as input display value?There is nothing in docs how to achive this behavior, so I guess it's a bug.
I was required to create custom function to achieve this, which is, in my opition, an additional unnecessary filter, which should be available via component.
EDIT: I also noticed that onchange event doesn't send new value to backend.
Beta Was this translation helpful? Give feedback.
All reactions