Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(dialog): shift+tab does not cycle through tabbable elements #12061

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

Splaktar
Copy link
Contributor

PR Checklist

Please check your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

-shift+tab gets stuck on the .md-dialog-container element and does not cycle back through the tabbable elements

Fixes #10963

What is the new behavior?

  • don't let shift+tab get stuck on the .md-dialog-container element
  • the new behavior of shift+tab matches Angular Material and the CDK
  • the old behavior, of tab stopping on the .md-dialog-container element as part of
    the tabindex cycle of a dialog, remains
    • this differs from Angular Material and the CDK which redirects the focus after the
      end focus trap to the first tabbable element, rather than the container
    • this behavior is left in place to minimize any possible disruption caused by this fix
  • fix out of date/inaccurate comments

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@google-cla google-cla bot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Dec 16, 2020
- don't let shift+tab get stuck on the `.md-dialog-container` element
- the new behavior of shift+tab matches Angular Material and the CDK
- the old behavior, of tab stopping on the `.md-dialog-container` element as part of
  the tabindex cycle of a dialog, remains
  - this differs from Angular Material and the CDK which redirects the focus after the
    end focus trap to the first tabbable element, rather than the container
  - this behavior is left in place to minimize any possible disruption caused by this fix
- fix out of date/inaccurate comments

Fixes #10963
@Splaktar Splaktar force-pushed the dialog-fix-shift-tab-cycle branch from 9f25436 to 81c9b22 Compare December 16, 2020 03:33
@Splaktar Splaktar self-assigned this Dec 16, 2020
@Splaktar Splaktar added this to the 1.2.2 milestone Dec 16, 2020
@Splaktar Splaktar added a11y This issue is related to accessibility g3: sync P2: required Issues that must be fixed. pr: merge ready This PR is ready for a caretaker to review labels Dec 16, 2020
@Splaktar Splaktar requested a review from mmalerba December 16, 2020 05:24
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

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

LGTM

@Splaktar Splaktar added the pr: lgtm This PR has been approved by the reviewer label Dec 16, 2020
@Splaktar Splaktar merged commit 7d5e262 into master Dec 16, 2020
@Splaktar Splaktar deleted the dialog-fix-shift-tab-cycle branch December 16, 2020 21:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ P2: required Issues that must be fixed. pr: lgtm This PR has been approved by the reviewer pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dialog: shift+tab doesn't loop properly after it reaches the beginning
2 participants