-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combobox displayValue regression in @headlessui/[email protected] #2084
Comments
It regressed in the sense that it now uses `displayValue` for the `defaultValue` as well, but if nothing is passed it would crash. Right now, it makes sure to only run the displayValue value on the actual value and the actual default value if they are not undefined. Note: if your displayValue is implemented like `(value) => value.name`, and your `value` is passed as `null`, it will still crash (as expected) because then you are in charge of rendering something else than null. If we would "fix" this, then no value can be rendered instead of `null`. Fixes: #2084
Hey! Thank you for your bug report! The reason this regressed is because we now also use the We now have some tests that should prevent this from happening in the future. This should be fixed by #2087, and will be available in the next release. You can already try it using:
|
Is this related? Building on NextJS fails with a ComboBox
|
What package within Headless UI are you using?
@headlessui/vue
What version of that package are you using?
v1.7.5
What browser are you using?
Firefox
Reproduction URL
https://stackblitz.com/edit/vue-ls2gkt?file=src/components/Combo.vue
Describe your issue
The latest release breaks the use of
displayValue
for Combobox. The reproduction link above shows the example from https://headlessui.com/vue/combobox (converted to options API for stackblitz). This code runs in headlessui/vue 1.7.4 but fails in 1.7.5 with errorperson is undefined
.The text was updated successfully, but these errors were encountered: