[combobox] Fix highlight change reason in ChipRemove#3980
[combobox] Fix highlight change reason in ChipRemove#3980atomiks merged 2 commits intomui:masterfrom
ChipRemove#3980Conversation
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. |
| store.state.setIndices({ | ||
| activeIndex: null, | ||
| type: store.state.keyboardActiveRef.current ? 'pointer' : 'keyboard', | ||
| type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer', |
There was a problem hiding this comment.
I was going through code of ComboBox, noticed slight descripency, In
https://github.com/sai6855/base-ui/blob/48c6258422710b995d2b3fcb4e1ef766dec23612/packages/react/src/combobox/input/ComboboxInput.tsx#L246
type is set to keyboard if store.state.keyboardActiveRef.current is true but here it's set to pointer
Greptile OverviewGreptile SummaryCorrected inverted boolean logic in Confidence Score: 5/5
Important Files Changed
|
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug in the ComboboxChipRemove component where the interaction type was incorrectly determined. The component was setting type: 'pointer' when keyboard was active and type: 'keyboard' when pointer was active, which is the opposite of the intended behavior.
Changes:
- Corrected the ternary expression in the
onClickhandler to properly mapkeyboardActiveRef.currentto the interaction type - Applied the same fix to the
onKeyDownhandler for consistency
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ChipRemove
Fix type handling in ComboboxChipRemove component