Update dialog example page and examples#480
Conversation
✅ Deploy Preview for accessibility-developer-guide ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
||
| | Aspect | Native `<dialog>` | Custom dialog (ARIA) | | ||
| | --- | --- | --- | | ||
| | Effort | Low | High | |
There was a problem hiding this comment.
here I have the same question as in #437 , is there a way to do row headers with markdown? Otherwise I can switch it to an html table.
There was a problem hiding this comment.
Chnaged. thank you!
|
Question: What is the reason for keeping any client-side JavaScript and not use the native dialog? I would be heavily in favor of deleting custom solutions. |
|
@backflip You mean using invoker commands instead? Good point but it's not for all browsers ready: https://caniuse.com/wf-invoker-commands |
RA11y1
left a comment
There was a problem hiding this comment.
The modal dialog functions well for NVDA on FF and Chrome. I want to check with @ReginaReusser on JAWS as well.
The non-modal dialog still captures the virtual cursor, NVDA has to switch to focus navigation using the tab key in order to leave the opened dialog.
Will resume at a later point when we were able to test with JAWS and the custom modal. Thx so far @rudigier !
| <p> | ||
| <button data-adg-native-dialog="my-dialog" aria-haspopup="dialog"> | ||
| Terms and conditions | ||
| <span class="adg-visually-hidden"> (dialog)</span> |
There was a problem hiding this comment.
| <span class="adg-visually-hidden"> (dialog)</span> |
There was a problem hiding this comment.
The aria-haspopup="dialog" already leads to an announcement by the SR that a dialog will be opened. Therefore the visually hidden span is not needed.
As a side note (longer than I intended... ): visually hidden text is announced extra when using NVDA + FF. In this case I will first get the output "Button Terms and conditions" and when navigating forward one step with the arrow key I will get the second output "Button (dialog)". With around 16% of screen reader users using FF this might be worth taking a closer look.
| Please read them carefully... | ||
| </p> | ||
| <p> | ||
| <button data-adg-dialog-confirm>Confirm<span class="adg-visually-hidden"> (close)</span></button> |
There was a problem hiding this comment.
Here as well, NVDA + FF will lead to two separate outputs for the visible and the visually hidden text when navigating with the virtual cursor. An alternative would be to use aria-label, this might have other downsides though (e.g. the aria-label text is not found by browser search, will have to check if and when that would be a problem).
@rudigier, we can still use JavaScript to open and close. But everything else can be completely removed unless I'm missing something. Example: https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement#examples |
@rudigier, I think the most future-proof approach would be invoker commands with a polyfill. So no custom JavaScript for opening/closing, just the polyfill which can be reduced at some point in the future. |
|
@backflip
@RA11y1 Removed some visible-hidden item, improved markup and added new examples to test :) |
This PR updates the Dialog chapter to better reflect current accessibility guidance and native-first implementation practices.
It adds a native example, refines the modal and non-modal examples, and clarifies when to use native dialogs versus custom ARIA-based implementations.
What changed