[combobox] Avoid clearing selected value if item is not present in items array#3824
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile SummaryThis PR removes the automatic value reconciliation logic that was clearing selected values when the
The change aligns with native Confidence Score: 5/5
Important Files Changed
|
sarthakmalik0810
left a comment
There was a problem hiding this comment.
Thank you for the quick fix @atomiks! Since this might have broken async Comboboxes, do you think the release for this fix could be expedited? Many thanks!
|
@sarthakmalik0810 async items when the selected value wasn't in the We're sticking to monthly releases except in critical cases, you can use 1.0.0 or the canary release in the meantime |
This avoids surprises with
valuegetting cleared (tonull) when the selected item isn't present initems, particularly in async combobox implementations. Native<select>s retain the previousvaluein state when the<option>gets removed from the list, with the exception that it automatically selects a fallback value which is a bit confusing hereFixes #3818
Fixes #3502