Make ModalDialog accessible by default

Aperta
#1,927 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
html, java, javascript

Direzione di ricerca

Start from the ModalDialog source in wicket-extensions, where the dialog element is rendered as a <div> and trapFocus()/closeOnEscape() are opt-in, then read the "Dialogs" section workaround in the user guide (#1847) that overrides newDialog. Compare both against the WAI-ARIA APG dialog pattern and the related WCAG audit (#1838). Done means the defaults emit role="dialog", aria-modal and an accessible name, move and restore focus, keep the rest of the page inert, plus a migration note and an updated guide section.

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

Descrizione

ModalDialog in wicket-extensions is not accessible out of the box. Focus handling is opt-in, and the dialog has no ARIA semantics, so screen readers don't announce it as a dialog. The accessibility chapter of the user guide (#1847, section "Dialogs") works around this by overriding newDialog. This issue asks to make that the dialog's default behaviour.

Current state:

  • The dialog element is a plain <div>. It has no role="dialog", no aria-modal="true" and no accessible name (WCAG 2.2 SC 4.1.2).
  • Focus trapping (trapFocus()) and Escape to close (closeOnEscape()) only work when the application calls them.
  • Content behind the overlay stays reachable for screen readers. Nothing makes it inert or aria-hidden while the dialog is open.

What an accessible version could do (see the WAI-ARIA APG dialog pattern):

  • Render role="dialog" and aria-modal="true", with a way to set aria-labelledby or aria-label, for instance from a title component in the content.
  • Move focus into the dialog when it opens, and give it back to the triggering element when it closes.
  • Consider making focus trapping and Escape to close the default, or using the native <dialog> element with showModal(), which provides most of this itself.
  • Update the user guide's "Dialogs" section once the workaround is no longer needed.

Changing the defaults affects existing applications, so the API and migration path need a decision in the PR.

Related: #1838 (WCAG 2.2 AA audit of the components).

Lingua principale
Java
Stelle
800
Fork
437
Merge medio
21h 36m
PR unite (30g)
167

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 apache/wicket

Tutte le issue di apache/wicket

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.