feat: cover keyboard navigation inside menus in the accessibility skill

Aperta Adatta ai principianti
#219 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter

Direzione di ricerca

Trova i contenuti della skill di accessibilità sull’accesso da tastiera e sui menu, poi controlla come descrive MenuAnchor e i test dei widget. Aggiungi il comportamento di focus richiesto, la navigazione con Tab e Shift+Tab e un esempio di test che verifichi il focus all’apertura e l’uscita da entrambe le estremità. Il lavoro è completo quando la skill documenta tutti e tre i comportamenti e sono soddisfatti i requisiti di CI e copertura dell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Shell
Stelle
180
Fork
25
Merge medio
1g 7h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di VeryGoodOpenSource/vgv-ai-flutter-plugin

Tutte le issue di VeryGoodOpenSource/vgv-ai-flutter-plugin

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.