Repository navigation
fix(a11y): scroll the selected row into view in Command Palette and Quick Switcher - #1397
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1369
Problem
Arrow Up / Down moved
_selectedbut theListViewhad 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: purerevealOffsetForItem(fixed-extent list, padding aware), shared by both dialogs.ScrollController; after a keyboard move the selected row is revealed withjumpTo(no new durations or curves). Typing resets the list to the top.onHoveruntil the pointer really moves (Listener.onPointerHover).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.