"Dialog" is not announced for modals
Created by: Malvoz
Repro steps:
- Start NVDA (or perhaps the screen reader of your choice)
- Visit https://getbootstrap.com/docs/5.0/components/modal/#live-demo
- Open the modal dialog
Expected: "Dialog" should be announced (along with the content of the modal).
Result: "Dialog" is not announced.
I noticed that manually moving role="dialog"
(although moving tabindex="-1"
instead may also work) from its current <div class="modal">
element to the child <div class="modal-dialog">
the result is that "dialog" is announced.
This may be an NVDA bug (I'll probably wait with reporting until I get feedback here). It could be that this has to do with the fact that the standard <dialog>
element must not have a tabindex
attribute, and therefore for some reason NVDA fails to announce the ARIA role, but perhaps that's totally unrelated.
If others can confirm that this does not work as expected (in NVDA and/or another screen reader) that'd be much appreciated.
Environment:
- Windows 10.0.19042
- Chrome 90.0.4430.85
- NVDA 2020.4
/cc @patrickhlauke