Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dialog): Move aria roles from dialog root to dialog surface element. #5239

Merged
merged 2 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions packages/mdc-dialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ npm install @material/dialog
### HTML Structure

```html
<div class="mdc-dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<div class="mdc-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<!-- Title cannot contain leading whitespace due to mdc-typography-baseline-top() -->
<h2 class="mdc-dialog__title" id="my-dialog-title"><!--
-->Dialog Title<!--
Expand Down Expand Up @@ -114,13 +114,13 @@ dialog.listen('MDCDialog:opened', () => {
The Simple Dialog contains a list of potential actions. It does not contain buttons.

```html
<div class="mdc-dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<div class="mdc-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<!-- Title cannot contain leading whitespace due to mdc-typography-baseline-top() -->
<h2 class="mdc-dialog__title" id="my-dialog-title"><!--
-->Choose a Ringtone<!--
Expand Down Expand Up @@ -150,13 +150,13 @@ The Confirmation Dialog contains a list of choices, and buttons to confirm or ca
radio buttons (indicating single selection) or checkboxes (indicating multiple selection).

```html
<div class="mdc-dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<div class="mdc-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<!-- Title cannot contain leading whitespace due to mdc-typography-baseline-top() -->
<h2 class="mdc-dialog__title" id="my-dialog-title"><!--
-->Choose a Ringtone<!--
Expand Down
10 changes: 5 additions & 5 deletions test/screenshot/spec/mdc-dialog/mixins/container-fill-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--container-fill-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
10 changes: 5 additions & 5 deletions test/screenshot/spec/mdc-dialog/mixins/content-ink-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--content-ink-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
10 changes: 5 additions & 5 deletions test/screenshot/spec/mdc-dialog/mixins/max-height.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--max-height"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/max-width.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--max-width"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--5-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/min-width.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--min-width"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title" id="test-dialog__title">Title</h2>
<div class="mdc-dialog__content test-dialog__content" id="test-dialog__content">
<div class="test-dialog__content-rect">
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/scrim-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--scrim-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/scroll-divider-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--scroll-divider-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/shape-radius.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--shape-radius"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/title-ink-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--title-ink-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down