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(slide-toggle): redirect focus to underlying input element #13957

Merged

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Nov 3, 2018

Currently the mat-slide-toggle doesn't redirect focus to the underlying input element. This means that things like the focus trap's cdkFocusInitial won't work when they're set on the toggle host. These changes add a tabindex and set up a focus listener to forward focus to the input.

Relates to #13953.

Currently the `mat-slide-toggle` doesn't redirect focus to the underlying `input` element. This means that things like the focus trap's `cdkFocusInitial` won't work when they're set on the toggle host. These changes add a `tabindex` and set up a `focus` listener to forward focus to the input.

Relates to angular#13953.
@crisbeto crisbeto added Accessibility This issue is related to accessibility (a11y) target: patch This PR is targeted for the next patch release labels Nov 3, 2018
@crisbeto crisbeto requested a review from devversion as a code owner November 3, 2018 10:42
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 3, 2018
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM

@devversion devversion added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Nov 3, 2018
@vivian-hu-zz vivian-hu-zz merged commit ec4809f into angular:master Nov 7, 2018
crisbeto added a commit to crisbeto/material2 that referenced this pull request Nov 9, 2018
Seems to be a regression from angular#13957. Since the focus monitor still tracks focus, even though the element is disabled, the focus ripple will show up when clicking on a disabled toggle.
vivian-hu-zz pushed a commit that referenced this pull request Nov 10, 2018
#14055)

Seems to be a regression from #13957. Since the focus monitor still tracks focus, even though the element is disabled, the focus ripple will show up when clicking on a disabled toggle.
vivian-hu-zz pushed a commit that referenced this pull request Nov 12, 2018
Currently the `mat-slide-toggle` doesn't redirect focus to the underlying `input` element. This means that things like the focus trap's `cdkFocusInitial` won't work when they're set on the toggle host. These changes add a `tabindex` and set up a `focus` listener to forward focus to the input.

Relates to #13953.
vivian-hu-zz pushed a commit that referenced this pull request Nov 12, 2018
#14055)

Seems to be a regression from #13957. Since the focus monitor still tracks focus, even though the element is disabled, the focus ripple will show up when clicking on a disabled toggle.
@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 Sep 10, 2019
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 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