You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Selector: navigation keys during a held sheet open, and a shorter isListShown comment (from #12075) #13751
🤖 (Posted by Cindy's agent.) Follow-ups from the review of #12075 (a Selector's bottom sheet loads on first use).
While a tap or key press waits for the sheet to load (a "held open"), #12075 keeps a second press, Enter and Space from closing the sheet or picking an option. Two smaller points remain:
Arrow, Home, End and Page keys during a held open still move the highlighted option before the sheet shows. Nothing is picked, and the sheet opens on the option the keys reached, so no one picks an option they can't see, but these keys could be held back the same way Enter is, so the highlight starts where a person expects when the sheet appears.
The isListShown comment in the combobox hooks could be shorter.
Done when: the navigation keys during a held open behave as decided (held back, or documented as buffered), with a test, and the comment is trimmed.
I read useComboboxInternal in packages/core/src/Selector/hooks.ts on current main, and this looks small enough that I would like to confirm the choice before I write it.
Where it stands. During a held open (isOpen && !isListShown), three inputs are already held back: a second trigger click returns early in onTriggerClick, and Enter and Space break before they can select. The ArrowDown, ArrowUp, Home, End, PageUp and PageDown cases have no such guard, so they still move highlightedIndex. The sheet then opens on whatever those keys reached.
Proposal (hold them back). Give those six cases the same guard Enter has, so the highlight stays where the open placed it (findOpeningIndex) until the list is shown. That matches how the other held inputs behave, keeps the opening highlight predictable, and needs one shared check in the handler rather than six. The alternative is to document the keys as buffered, which leaves the current behavior and a sheet that can open on an option the person never saw highlighted.
Also in this issue. I would shorten the isListShown comment on UseComboboxInternalOptions and keep its one claim: a held open repeats instead of closing the list or picking an unseen option. MultiSelector/hooks.ts takes the same option, so I would check it moves in step.
Test. One case in Selector.sheetHeldInputs.test.tsx: during the held open, the navigation keys leave the opening highlight alone, and after the frame arrives the sheet opens on that option. A MultiSelector case if its hook shares the guard.
Hold back, or document as buffered? I will start once there is an answer.
🤖 (Posted by Cindy's agent.) Thanks for reading it so carefully, @HelloOjasMutreja, and for checking before writing it! A maintainer decision: go with holding the keys back.
While an open is held (the sheet is still loading, so no list is shown yet), there's no option to move a highlight across. So Arrow, Home, End and Page keys shouldn't move the highlight during the hold; the sheet opens at its normal opening option. The rule is that the latest action before the sheet loads is held and replayed once when it loads: a later action replaces a held one rather than adding to it.
One optional refinement: if a Selector's closed-trigger keys normally open at a different option (for example, ArrowUp or End opening at the last option), the latest such key may replace the held open with that key's opening option. That replaces the open; it still doesn't move a highlight step by step.
For tests: a navigation key during a held open leaves the opening option unchanged (or replaces it by that rule), and the sheet opens with that option highlighted. The shorter isListShown comment and the MultiSelector check you mentioned fit in the same change. You're welcome to go ahead!
Activity
HelloOjasMutreja commentedon Nov 25, 2026
I read
useComboboxInternalinpackages/core/src/Selector/hooks.tson currentmain, and this looks small enough that I would like to confirm the choice before I write it.Where it stands. During a held open (
isOpen && !isListShown), three inputs are already held back: a second trigger click returns early inonTriggerClick, and Enter and Spacebreakbefore they can select. TheArrowDown,ArrowUp,Home,End,PageUpandPageDowncases have no such guard, so they still movehighlightedIndex. The sheet then opens on whatever those keys reached.Proposal (hold them back). Give those six cases the same guard Enter has, so the highlight stays where the open placed it (
findOpeningIndex) until the list is shown. That matches how the other held inputs behave, keeps the opening highlight predictable, and needs one shared check in the handler rather than six. The alternative is to document the keys as buffered, which leaves the current behavior and a sheet that can open on an option the person never saw highlighted.Also in this issue. I would shorten the
isListShowncomment onUseComboboxInternalOptionsand keep its one claim: a held open repeats instead of closing the list or picking an unseen option.MultiSelector/hooks.tstakes the same option, so I would check it moves in step.Test. One case in
Selector.sheetHeldInputs.test.tsx: during the held open, the navigation keys leave the opening highlight alone, and after the frame arrives the sheet opens on that option. AMultiSelectorcase if its hook shares the guard.Hold back, or document as buffered? I will start once there is an answer.
cixzhang commentedon Nov 25, 2026
🤖 (Posted by Cindy's agent.) Thanks for reading it so carefully, @HelloOjasMutreja, and for checking before writing it! A maintainer decision: go with holding the keys back.
While an open is held (the sheet is still loading, so no list is shown yet), there's no option to move a highlight across. So Arrow, Home, End and Page keys shouldn't move the highlight during the hold; the sheet opens at its normal opening option. The rule is that the latest action before the sheet loads is held and replayed once when it loads: a later action replaces a held one rather than adding to it.
One optional refinement: if a Selector's closed-trigger keys normally open at a different option (for example, ArrowUp or End opening at the last option), the latest such key may replace the held open with that key's opening option. That replaces the open; it still doesn't move a highlight step by step.
For tests: a navigation key during a held open leaves the opening option unchanged (or replaces it by that rule), and the sheet opens with that option highlighted. The shorter
isListShowncomment and the MultiSelector check you mentioned fit in the same change. You're welcome to go ahead!fix(MultiSelector): hold ArrowLeft and ArrowRight in a grid while a s…
fix(Selector, MultiSelector): the highlight keys are held back while …