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

docs(material/stepper): expand a11y section #23617

Merged
merged 1 commit into from Sep 23, 2021

Conversation

amysorto
Copy link
Contributor

No description provided.

@amysorto amysorto added P2 The issue is important to a large percentage of users, with a workaround Accessibility This issue is related to accessibility (a11y) docs This issue is related to documentation target: patch This PR is targeted for the next patch release area: material/stepper labels Sep 22, 2021
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 22, 2021
@@ -222,3 +222,19 @@ is given `role="tab"`, and the content that can be expanded upon selection is gi
step content is automatically set based on step selection change.

The stepper and each step should be given a meaningful label via `aria-label` or `aria-labelledby`.

When a stepper is used on a smaller screen, verical steppers are preferred over
Copy link
Member

Choose a reason for hiding this comment

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

verical -> vertical

Copy link
Member

Choose a reason for hiding this comment

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

Prefer vertical steppers when building for small screen sizes, as horizontal steppers typically take up significantly more horizontal space, thus introducing horizontal scrolling. Applications with multiple scrolling dimensions make content harder to consume for some users. See the [Responsive Stepper section](#responsive-stepper) above for an example on building a stepper that adjusts its layout based on viewport size.
  • Eliminates passive voice (e.g. "stepper is used", "steppers are preferred")
  • Adds some context on why folks would want to be careful with horizontal steppers on small screens
  • Links to the example above

@@ -222,3 +222,19 @@ is given `role="tab"`, and the content that can be expanded upon selection is gi
step content is automatically set based on step selection change.

The stepper and each step should be given a meaningful label via `aria-label` or `aria-labelledby`.

When a stepper is used on a smaller screen, verical steppers are preferred over
horizontal steppers because the text in the header will be more visible.
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth mentioning here that there's an example of a responsive stepper further up in the doc.

horizontal steppers because the text in the header will be more visible.

#### Forms
Steppers often have forms inside of it. It's best practice for form fields to
Copy link
Member

Choose a reason for hiding this comment

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

inside of it -> inside of them

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Steppers often have forms inside of it. It's best practice for form fields to
Steppers often contain forms and form controls. If validation errors inside of a stepper's form prevents moving to another step, make sure that your form controls communicate error messages to assistive technology. This helps the user know why they can't advance to another step. You can accomplish this by using `<mat-error>` with `<mat-form-field>`, or by using an ARIA live region.
  • Changes for passive voice and grammar
  • Clarify that <mat-error> is one possible way to communicate updates


#### Forms
Steppers often have forms inside of it. It's best practice for form fields to
have `<mat-error>` for fields that can be incorrect and throw an error.
Copy link
Member

Choose a reason for hiding this comment

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

nit: I'm not sure that "throw an error" is the correct terminology here since it sounds like there was an actual runtime error, whereas these are validation errors.

@@ -222,3 +222,19 @@ is given `role="tab"`, and the content that can be expanded upon selection is gi
step content is automatically set based on step selection change.

The stepper and each step should be given a meaningful label via `aria-label` or `aria-labelledby`.

When a stepper is used on a smaller screen, verical steppers are preferred over
Copy link
Member

Choose a reason for hiding this comment

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

Prefer vertical steppers when building for small screen sizes, as horizontal steppers typically take up significantly more horizontal space, thus introducing horizontal scrolling. Applications with multiple scrolling dimensions make content harder to consume for some users. See the [Responsive Stepper section](#responsive-stepper) above for an example on building a stepper that adjusts its layout based on viewport size.
  • Eliminates passive voice (e.g. "stepper is used", "steppers are preferred")
  • Adds some context on why folks would want to be careful with horizontal steppers on small screens
  • Links to the example above

horizontal steppers because the text in the header will be more visible.

#### Forms
Steppers often have forms inside of it. It's best practice for form fields to
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Steppers often have forms inside of it. It's best practice for form fields to
Steppers often contain forms and form controls. If validation errors inside of a stepper's form prevents moving to another step, make sure that your form controls communicate error messages to assistive technology. This helps the user know why they can't advance to another step. You can accomplish this by using `<mat-error>` with `<mat-form-field>`, or by using an ARIA live region.
  • Changes for passive voice and grammar
  • Clarify that <mat-error> is one possible way to communicate updates

Comment on lines 237 to 240
When you navigate away from a step with an error in a non-linear stepper, the
error message appears in the step header. Announcing the error with
`liveAnnouncer` will help screen reader users know that the step they just
navigated away from has an error.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
When you navigate away from a step with an error in a non-linear stepper, the
error message appears in the step header. Announcing the error with
`liveAnnouncer` will help screen reader users know that the step they just
navigated away from has an error.
When a step contains a forms validation error, `MatStepper` will display the error in the step's header. For non-linear steppers, you should use an ARIA live region to announce error messages when users navigate away from a step with an error message.

Is this accurate to what you're trying to get across?

@amysorto
Copy link
Contributor Author

Thanks for the comments!

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 aside from one typo (which probably came from me)

you can mark this PR as "merge ready" when done

@@ -222,3 +222,23 @@ is given `role="tab"`, and the content that can be expanded upon selection is gi
step content is automatically set based on step selection change.

The stepper and each step should be given a meaningful label via `aria-label` or `aria-labelledby`.

Prefer verticl steppers when building for small screen sizes, as horizontal
steppers typically take up significantly more horizontal space thus introducing
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
steppers typically take up significantly more horizontal space thus introducing
steppers typically take up significantly more horizontal space thus introduce

@amysorto amysorto added the action: merge The PR is ready for merge by the caretaker label Sep 23, 2021
@amysorto amysorto merged commit 8c81fb7 into angular:master Sep 23, 2021
amysorto added a commit that referenced this pull request Sep 23, 2021
@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 Oct 24, 2021
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 area: material/stepper cla: yes PR author has agreed to Google's Contributor License Agreement docs This issue is related to documentation P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants