feat: cover keyboard navigation inside menus in the accessibility skill

Open Beginner friendly
#219 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
dart, flutter

Research direction

Find the accessibility skill content about keyboard access and menus, then check how it describes MenuAnchor and widget tests. Add the requested focus behavior, Tab and Shift+Tab navigation, and a test example covering focus on open and leaving at both ends. Done means the skill documents all three behaviors and the issue's CI and coverage requirements pass.

Written by the indexing model from the issue text.

Description

feature
Description

The accessibility skill covers the basics of keyboard access well: controls must be reachable with Tab, dismissable with Escape, and announced correctly to screen readers. One case it doesn't cover yet is moving through a menu with the keyboard.

When a MenuAnchor opens from Enter, focus stays on the button that opened it. Arrow keys move into the menu, but Tab skips the menu and moves to the next control on the page. A keyboard user who expects Tab to walk through the menu's entries, as it does on many websites, lands somewhere else and the menu stays open behind them.

The suggestion is to add this case to the skill, so menus built with MenuAnchor move focus into the menu when it opens and let Tab and Shift+Tab move between its entries.

Related: #218 covers a different keyboard gap in the same skill (Enter on the web for custom buttons).

Requirements
  • The accessibility skill says that opening a menu with the keyboard moves focus to its first entry.
  • The skill says Tab and Shift+Tab move between the menu's entries, and that going past the first or last entry closes the menu and puts focus back on its button or on the next control.
  • The skill shows how to test this in a widget test: focus on open, Tab and Shift+Tab between entries, and leaving the menu at either end.
  • All CI/CD checks are passing.
  • There is no drop in the test coverage percentage.
Additional Context

One way to build it: give each MenuItemButton a FocusNode, request focus on the first one in MenuAnchor.onOpen (after the next frame, once the entries exist), and wrap each entry in Actions that handle NextFocusIntent and PreviousFocusIntent to move to the next or previous entry, closing the menu past either end.

Dominant language
Shell
Stars
180
Forks
25
Avg merge
1d 7h
Merged PRs (30d)
17

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from VeryGoodOpenSource/vgv-ai-flutter-plugin

All issues in VeryGoodOpenSource/vgv-ai-flutter-plugin

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.