Skip to content

Remove role="document" from the dialog and add aria-modal="true" #30687

@DavidMacDonald

Description

@DavidMacDonald

Current Code

<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">

Solution code

<div class="modal" tabindex="-1" role="dialog" aria-modal="true">
 <div class="modal-dialog" >

Rational

Document role is only necessary if there role="application" on a parent that overrides screen reader short cut keys.
The role="dialog" doesn't do that, so it's fine without it ... see aria-practices example
https://w3c.github.io/aria-practices/examples/dialog-modal/dialog.html

aria-modal="true" ensure the screen reader user cannot arrow out of the modal inadvertently and replaces the old technique (not used in bootstrap) of aria-hidden on all background content.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions