Make ModalDialog accessible by default
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- html, java, javascript
- Domain
- accessibility, frontend
Research direction
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.
Written by the indexing model from the issue text.
Description
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
dialogelement is a plain<div>. It has norole="dialog", noaria-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
inertoraria-hiddenwhile the dialog is open.
What an accessible version could do (see the WAI-ARIA APG dialog pattern):
- Render
role="dialog"andaria-modal="true", with a way to setaria-labelledbyoraria-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 withshowModal(), 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).
- Dominant language
- Java
- Stars
- 800
- Forks
- 437
- Avg merge
- 21h 36m
- Merged PRs (30d)
- 167
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/wicket
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyPossibly taken @vaibhavgupta443 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/wicket#1991 · 1 comment ·
Maintainers usually reply within 1 day
-
Stop the autocomplete from accumulating request parameters while typingPossibly taken @aryankalantri claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/wicket#1947 · 2 comments ·
Maintainers usually reply within 1 day
-
Validate the report-uri value given to CSPHeaderConfiguration#reportBackPossibly taken @AzizOuertani claimed this 3 days ago. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/wicket#1946 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
Maintainers usually reply within 1 day
Similar issues
-
account assessment course feature lecture
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
app:learninggoalhub enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100