Skip to content

fix(material/button-toggle): fix ChromeVox focus issue on button toggle - #21046

Merged
mmalerba merged 2 commits into
angular:masterfrom
annieyw:button-toggle-aria
Dec 3, 2020
Merged

fix(material/button-toggle): fix ChromeVox focus issue on button toggle#21046
mmalerba merged 2 commits into
angular:masterfrom
annieyw:button-toggle-aria

Conversation

@annieyw

@annieyw annieyw commented Nov 13, 2020

Copy link
Copy Markdown
Contributor

Fixes focus issue with Chromevox in which you need to hit arrow key twice to move to the next button-toggle.

@annieyw annieyw added Accessibility This issue is related to accessibility (a11y) G This is is related to a Google internal issue labels Nov 13, 2020
@annieyw
annieyw requested a review from jelbourn November 13, 2020 21:48
@google-cla google-cla Bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 13, 2020
@annieyw
annieyw marked this pull request as ready for review November 13, 2020 23:04
Comment thread src/material/button-toggle/button-toggle.ts
@annieyw
annieyw requested a review from devversion as a code owner November 16, 2020 22:31
@annieyw
annieyw force-pushed the button-toggle-aria branch 2 times, most recently from c61d6a4 to f056c04 Compare November 17, 2020 20:16

@crisbeto crisbeto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread src/cdk/a11y/focus-trap/focus-trap.ts Outdated
return true;
} else {
return false;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: you can simplify this to:

focusableChild?.focus();
return !!focusableChild;

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Nov 17, 2020
@annieyw annieyw added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note 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 labels Nov 18, 2020
@annieyw

annieyw commented Nov 18, 2020

Copy link
Copy Markdown
Contributor Author

Note: people may be calling .focus() directly on the <mat-button-toggle> element and this will break it.

@wagnermaciel

Copy link
Copy Markdown
Contributor

@annieyw One of your commit messages isn't formatted correctly

@annieyw

annieyw commented Nov 19, 2020

Copy link
Copy Markdown
Contributor Author

fixed commit message

@mmalerba
mmalerba merged commit 39e4e24 into angular:master Dec 3, 2020
mmalerba pushed a commit that referenced this pull request Dec 3, 2020
…le (#21046)

* fix(material/button-toggle): fix ChromeVox focus issue on button toggle

* fix(cdk/a11y): change focus trap to find focusable child element if cdkFocusInitial element isn't focusable

(cherry picked from commit 39e4e24)
crisbeto added a commit to crisbeto/material2 that referenced this pull request Dec 11, 2020
Removes the `tabindex` from the host node, because it causes some a11y issues.
We had it there before so that things like `cdkFocusInitial` would work, but
after angular#21046 it isn't necessary anymore.

Fixes angular#21266.
@annieyw
annieyw deleted the button-toggle-aria branch December 11, 2020 17:28
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Jan 11, 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 cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note 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.

4 participants