dashorst opened a new issue, #1927:
URL: https://github.com/apache/wicket/issues/1927

   `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](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/)):
   
   - 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).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to