[combobox] Keep native Home/End behavior when the key targets a text field - #5539
[combobox] Keep native Home/End behavior when the key targets a text field#5539sai6855 wants to merge 9 commits into
Conversation
|
@claude review |
|
The review finished without producing a report. 🤖 Review generated with Claude Code · Opus 5 (High) · |
commit: |
|
@claude review |
PR reviewThe one-line runtime change is sound and well targeted: when a Tests (2)1. 🟠 No test covers unmodified
|
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bundle size
PerformanceTotal duration: 1,086.65 ms +100.63 ms(+10.2%) | Renders: 92 (+0) | Paint: 1,772.21 ms +139.50 ms(+8.5%)
14 tests within noise — details Metric alarms
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Both keys share the same guards and differ only in the target index, so handle them in a single branch. Cover unmodified Home inside a combobox popup, where the input owns the caret, and Ctrl+Home/End in a menu.
Home was already covered; End takes the same branch with the opposite index, so assert the caret lands at the end of the value while the list highlight stays put. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@claude review |
PR reviewThe runtime change is narrow and looks correct: Bugs (1)1. ℹ️ Modified
|
`user-event` emulates Home/End by collapsing the caret, so the existing tests could only pin the mechanism: the highlight staying put and the event reaching the document un-prevented. Dispatch real key events over CDP instead, the way the menu and dialog tests already do, and assert the selection actually extends to the start or end of the value. Both cases fail without the guard. Fold the modifier cases into one parameterized test, which also covers Ctrl+End, release the keydown listener in a `finally`, and reword the guard's comment: it applies to any typeable target, not only a combobox whose input renders inside the popup. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
SInce Menu doesn't have |
fix #5480