-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
fix(combobox): highlight values remain when items changed #1841
fix(combobox): highlight values remain when items changed #1841
Conversation
🦋 Changeset detectedLatest commit: ac4e204 The changes in this PR will be included in the next version bump. This PR includes changesets to release 75 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@erm1116 is attempting to deploy a commit to the Chakra UI Team on Vercel. A member of the Team first needs to authorize it. |
@zag-js/anatomy
@zag-js/anatomy-icons
@zag-js/docs
@zag-js/core
@zag-js/store
@zag-js/types
commit: |
Closes #
📝 Description
In Combobox, when we want to display something like
no option
when filtering by input, an unintended highilghtedValue is kept in the internal state.This would cause an empty item (like value=‘something’, item=null) to be selected, so this issue has been fixed.
⛳️ Current behavior (updates)
CleanShot.2024-09-11.at.12.00.02.mp4
🚀 New behavior
When items changed (in other word, to change the children node), forced update the highlighted value.
This ensures that the highlight value is not an unintended,
because the value of
ctx.collection.firstValue
will be null if items is not present and null will be forced set.CleanShot.2024-09-11.at.12.01.57.mp4
💣 Is this a breaking change (Yes/No):
📝 Additional Information
I thought about preventing value changes when item=null, but I thought that the problem was that the highlight was still remain so I fix like this PR.