Make ModalDialog accessible by default

オープン
#1,927 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
html, java, javascript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
Java
スター
800
フォーク
437
平均マージ
21時間 36分
マージ済み PR(30日)
167

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/wicket のほかの issue

apache/wicket の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。