Skip to content

fix(a11y): scroll the selected row into view in Command Palette and Quick Switcher - #1397

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1369-palette-scroll-selection
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1369-palette-scroll-selection

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1369

Problem

Arrow Up / Down moved _selected but the ListView had no controller, so with more rows than fit the 360 px dialog the selection left the viewport: the user could not see what Enter would run. Rows also did not tell screen readers which one is highlighted.

Change

  • list_reveal.dart: pure revealOffsetForItem (fixed-extent list, padding aware), shared by both dialogs.
  • Both dialogs get a ScrollController; after a keyboard move the selected row is revealed with jumpTo (no new durations or curves). Typing resets the list to the top.
  • Keyboard scrolling moves rows under a still pointer, and that hover would take the selection back. A flag set by keyboard moves suppresses onHover until the pointer really moves (Listener.onPointerHover).
  • Rows are wrapped in Semantics(button: true, selected: active).

Tests

  • list_reveal_test.dart: the offset maths.
  • palette_keyboard_scroll_test.dart: Arrow Down past the viewport scrolls, Arrow Up scrolls back, typing resets (palette and switcher).

Not run locally; CI is the check.

… Switcher

- attach a ScrollController and reveal the selected row after Arrow Up/Down
  (pure revealOffsetForItem helper with unit tests)
- reset the list to the top when the query changes
- ignore the hover a keyboard scroll causes under a still pointer
- wrap rows in Semantics(button, selected) so the highlight is announced
Closes #1369.
@github-actions github-actions Bot added bug Something isn't working frontend Theme parser epic label: frontend accessibility Reduced motion, OS accessibility preferences ux User experience, keyboard shortcuts and interactions P2 Medium priority / Parity & Refactoring labels Oct 10, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit f0cf857 into dev Oct 10, 2026
13 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1369-palette-scroll-selection branch October 11, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Reduced motion, OS accessibility preferences bug Something isn't working frontend Theme parser epic label: frontend P2 Medium priority / Parity & Refactoring ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant