-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conversation
e0c8789
to
679c5dc
Compare
@@ -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> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"/> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
8d580fc
to
e8756f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
@tinayuangao Rebase? |
e11e0d1
to
a20d419
Compare
@kara Rebased. Thanks! |
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.
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.
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.
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.
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.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.