Documentation required to address Safari list-style affecting list role

Aperta
#145 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
css

Direzione di ricerca

Inizia dalla demo del componente Pagination e riproduci il problema dell'annuncio dell'elenco usando VoiceOver con Safari. Documenta le soluzioni alternative con role="list" e pseudo-elementi CSS descritte qui, incluso quando ciascuna può essere appropriata; il lavoro è completato quando gli sviluppatori possono comprendere e applicare la soluzione documentata.

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

Descrizione

Hullo all.

Whilst creating accessible components that use list elements styled with list-style:none;, we have noted that VO with Safari will no longer announce the element as a list, nor the elements within it as list items. It would appear that using this CSS property in Safari affects the role that the list has in the a11y tree. There are a couple of ways to get around this:

  1. When using a list, add role="list" to the element. We found this to be confusing to come across as engineers, as at a quick glance it would seem redundant. We would be forced to leave comments in multiple places to explain why it was there.

  2. In WebCore we have implemented a different method of removing the default list style in our reset stylesheet:

ol, ul {
	list-style: none;
}

li:before {
	content: "\\200B";
	position: absolute;
}

In short, we still remove the list style, but we then use a pseudo-element to force Safari into thinking that we're setting our own bullet style. In reality, \\200B is a zero-width space. The element is then announced as a list again.

A good example of where this happens is the Pagination component demo - the pages are marked up as a list, but not announced as such in VO + Safari.

It would be great to document a solution - even if we offer both the role and the CSS workaround as options for devs and let them make their own decision on which fits best in their codebase.

Any questions feel free to slack me or comment. :) Thanks.

Lingua principale
JavaScript
Stelle
50
Fork
19
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 bbc/gel

Tutte le issue di bbc/gel

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.