-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
docs(a11y): Adding accessibility sections to datepicker, menu, slide … #6710
Conversation
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.
One nit, otherwise LGTM
src/lib/snack-bar/snack-bar.md
Outdated
@@ -72,3 +72,7 @@ export class MessageArchivedComponent { | |||
constructor(@Inject(MD_SNACK_BAR_DATA) public data: any) { } | |||
} | |||
``` | |||
### Accessibility | |||
A Snackbar automatically goes away after a short time, so you can't count on the user seeing the |
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.
Nit: To be consistent with the rest of the doc, use snack-bar
instead of Snackbar
?
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.
Changed to snack-bar
. Thanks for review.
LGTM |
src/lib/datepicker/datepicker.md
Outdated
@@ -228,3 +228,6 @@ application root module. | |||
}) | |||
export class MyApp {} | |||
``` | |||
### Accessibility | |||
The input box for datepicker should have a placeholder or be given a meaningful label via |
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'd like to expand this to describe what the datepicker does in general (input with aria-haspopup that triggers a role="dialog"
) along with the keyboard shortcuts, but that can go in another PR.
src/lib/datepicker/datepicker.md
Outdated
@@ -228,3 +228,6 @@ application root module. | |||
}) | |||
export class MyApp {} | |||
``` | |||
### Accessibility | |||
The input box for datepicker should have a placeholder or be given a meaningful label via | |||
`aria-label` or `aria-labelledby`. |
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.
We should mention that MdDatepickerIntl
includes strings that are used for aria-label
s.
src/lib/snack-bar/snack-bar.md
Outdated
@@ -72,3 +72,7 @@ export class MessageArchivedComponent { | |||
constructor(@Inject(MD_SNACK_BAR_DATA) public data: any) { } | |||
} | |||
``` | |||
### Accessibility | |||
A snack-bar automatically goes away after a short time, so you can't count on the user seeing the |
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 would phrase this as
Snack-bar messages are announced via an `aria-live` region. Focus is not moved to
the snack-bar element, as this would be disruptive to a user in the middle of a
workflow. For any action offered in the snack-bar, the application should offer the
user an alternative way to perform the action (typically via keyboard shortcut).
src/lib/toolbar/toolbar.md
Outdated
@@ -49,3 +49,7 @@ easily accomplished with `display: flex`: | |||
The color of a `<md-toolbar>` can be changed by using the `color` property. By default, toolbars | |||
use a neutral background color based on the current theme (light or dark). This can be changed to | |||
`'primary'`, `'accent'`, or `'warn'`. | |||
|
|||
### Accessibility | |||
Toolbar items without text or labels should be given a meaningful label via `aria-label` or |
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 think this isn't quite right. Similar to list
and grid-list
, we treat toolbar as decorative-only by default. Generally, the toolbar is used as a header where role="header"
would be appropriate.
Only if the use-case of the toolbar match that of role="toolbar"
, the user should add the role and an appropriate label.
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
e07db8d
to
604e728
Compare
Comments addressed. Please take another look. Thanks! |
src/lib/datepicker/datepicker.md
Outdated
|
||
#### Keyboard shortcuts | ||
The keyboard shortcuts to handle datepicker are: | ||
`ALT` + `DOWN_ARROR`: trigger calendar 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.
ARROR
-> ARROW
should have a placeholder or be given a meaningful label via `aria-label`, `aria-labelledby` or | ||
`MdDatepickerIntl`. | ||
|
||
#### Keyboard shortcuts |
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 would be good to put these in a table, e.g.
| Shortcut | Action |
|----------------------|---------------------------|
| `ALT` + `DOWN_ARROW` | Open the calendar pop-up |
| `ESCAPE` | Close the calendar pop-up |
src/lib/datepicker/datepicker.md
Outdated
#### Keyboard shortcuts | ||
The keyboard shortcuts to handle datepicker are: | ||
|
||
`ALT` + `DOWN_ARROR`: trigger calendar 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.
ARROR
-> ARROW
LGTM on datepicker and slider |
Put shortcuts in tables. Please take another look. Thanks! |
src/lib/datepicker/datepicker.md
Outdated
| `LEFT_ARROW` | Goes to previous day | | ||
| `RIGHT_ARROW` | Goes to next day | | ||
| `UP_ARROW` | Goes to previous 7 days | | ||
| `DOWN_ARROW` | Goes to next 7 days | |
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.
Goes
-> Go
for each of these
For up and down arrow, I'd say Go to same day in the next week
src/lib/datepicker/datepicker.md
Outdated
| `UP_ARROW` | Goes to previous 7 days | | ||
| `DOWN_ARROW` | Goes to next 7 days | | ||
| `HOME` | Focus the first day of the month | | ||
| `END` | Focus the last day of the month | |
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.
Why say Focus
for home/end and Goes
/ Go
everywhere else?
…toggle, slider, snackbar and toolbar
Changed to |
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
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. |
…toggle, slider, snackbar and toolbar