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

demo(dialog): Add accessibility demo page for dialog #6360

Merged
merged 3 commits into from
Aug 21, 2017

Conversation

tinayuangao
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 8, 2017
@tinayuangao tinayuangao requested a review from jelbourn August 8, 2017 22:59
@tinayuangao tinayuangao added Accessibility This issue is related to accessibility (a11y) pr: needs review labels Aug 8, 2017
@@ -0,0 +1,23 @@
<section>
<h2>Welcome message</h2>
<p>Activat the button to see a welcome dialog with a simple message and a close button.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Activat -> Activate

template: `Welcome to Angular Material dialog demo page!

<md-dialog-actions>
<button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this dialog have some other content?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking a <p> with some text

<h2 md-dialog-title>Neptune</h2>

<md-dialog-content>
<img src="https://upload.wikimedia.org/wikipedia/commons/5/56/Neptune_Full.jpg"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img needs an alt

md-button
color="primary"
href="https://en.wikipedia.org/wiki/Neptune"
target="_blank">Read more on Wikipedia</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indent / line-breaking here is odd

@@ -0,0 +1,12 @@
<h2 md-dialog-title>Neptune</h2>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the focus go when this dialog is opened?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Close" button in the dialog.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that having the focus start after all of the dialog content is weird

@tinayuangao @crisbeto what do you think of adding a dialog config option like focusDialogElementOnOpen (and also ariaLabel) to help with dialogs like this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does make sense, although specifying what element takes precedence in the focus trap should already be possible through the cdk-focus-initial attribute.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't give a way to focus the role="dialog" element, though, which I think is what we'd want (but I'm not 100% sure).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a config option makes sense to me.

I added another example for forms. The focus goes to the first input box in the form when the dialog is opened.

@tinayuangao tinayuangao force-pushed the a11y-dialog branch 2 times, most recently from 8d580fc to e8756f0 Compare August 17, 2017 19:07
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Aug 18, 2017
crisbeto added a commit to crisbeto/material2 that referenced this pull request Aug 20, 2017
Based on the discussion on angular#6360 (comment), these changes add the ability to set the `aria-label` of a dialog, as well as the element that should be focus when the dialog is opened.
@kara kara added pr: needs rebase and removed action: merge The PR is ready for merge by the caretaker labels Aug 21, 2017
@kara
Copy link
Contributor

kara commented Aug 21, 2017

@tinayuangao Rebase?

@tinayuangao
Copy link
Contributor Author

@kara Rebased. Thanks!

@kara kara added the action: merge The PR is ready for merge by the caretaker label Aug 21, 2017
@kara kara merged commit 7b54e1d into angular:master Aug 21, 2017
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 13, 2017
Based on the discussion on angular#6360 (comment), these changes add the ability to set the `aria-label` of a dialog, as well as the element that should be focus when the dialog is opened.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 14, 2017
Based on the discussion on angular#6360 (comment), these changes add the ability to set the `aria-label` of a dialog, as well as the element that should be focus when the dialog is opened.
jelbourn pushed a commit that referenced this pull request Nov 19, 2017
Based on the discussion on #6360 (comment), these changes add the ability to set the `aria-label` of a dialog, as well as the element that should be focus when the dialog is opened.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 19, 2017
Based on the discussion on angular#6360 (comment), these changes add the ability to set the `aria-label` of a dialog, as well as the element that should be focus when the dialog is opened.
jelbourn pushed a commit that referenced this pull request Nov 20, 2017
Based on the discussion on #6360 (comment), these changes add the ability to set the `aria-label` of a dialog, as well as the element that should be focus when the dialog is opened.
@tinayuangao tinayuangao deleted the a11y-dialog branch March 9, 2018 23:31
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants