Make ModalDialog accessible by default

Đang mở
#1,927 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
html, java, javascript
Lĩnh vực
accessibility, frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Java
Star
800
Fork
437
Merge trung bình
21 giờ 36 phút
Pull request đã merge (30 ngày)
167

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/wicket

Tất cả issue của apache/wicket

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.