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

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

Merged
merged 2 commits into from
Dec 3, 2020

Conversation

annieyw
Copy link
Contributor

@annieyw annieyw commented Nov 13, 2020

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
@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
@annieyw annieyw force-pushed the button-toggle-aria branch 2 times, most recently from c61d6a4 to f056c04 Compare November 17, 2020 20:16
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

return true;
} else {
return false;
}
Copy link
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
Copy link
Contributor Author

annieyw commented Nov 18, 2020

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

@wagnermaciel
Copy link
Contributor

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

@annieyw
Copy link
Contributor Author

annieyw commented Nov 19, 2020

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

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.

None yet

4 participants