Keyboard navigation doesn't work on navigation menus

Aperta
#2,404 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
javascript, jquery

Direzione di ricerca

Inizia dalla gestione della tastiera del widget Menu e dal percorso select-event per un ul contenente elementi li con link, riproducendo il caso menu() descritto nell’issue. Il lavoro è completato quando Return e Space attivano il link selezionato senza richiedere un handler personalizzato né causare clic ricorsivi; l’issue non indica alcun file sorgente o test.

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

Descrizione

Needs info

Now that accessibility is becoming a requirement in public institutions in US, I'm trying to evaluate accessibility of our code. In particular I'm trying keyboard navigation in a menu that uses your Menu widget. The menu's structure is a 'ul' container of 'li' items, with an 'a' inside each 'li' linking to a different page.

If I only use a 'menu()' call on the 'ul' element, arrow navigation works fine, but nothing happens when I press 'return' or 'space'. If I add a handler for the 'select' event that triggers a 'click' on the 'a' element, it gets into a loop and I get a 'Uncaught InternalError: too much recursion'.

I thought I could avoid it by checking whether the 'ui.item[0]' is different from 'ui.item.prevObject[0]' before triggering the 'click' event, but they seem to always be the same.

So I'm out of options here, either I'm missing something or there's a bug somewhere. I'd say it should work without any customization, as this is a widespread pattern.

Lingua principale
JavaScript
Stelle
11.3k
Fork
5.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 jquery/jquery-ui

Tutte le issue di jquery/jquery-ui

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.