Skip to content

fix(checkbox): redirect focus to underlying input element #14473

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

Conversation

crisbeto
Copy link
Member

Currently the mat-checkbox host element isn't focusable, which means that if consumers decided to use something like cdkFocusInitial on it, nothing would happen. These changes tweak the tabindex so the element is focusable and add a focus listener that'll redirect focus to the input.

Relates to #13953.

Note: this is a resubmit of #13959.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Dec 11, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 11, 2018
@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Dec 11, 2018
@ngbot
Copy link

ngbot bot commented Dec 11, 2018

I see that you just added the pr: merge ready label, but the following checks are still failing:
    failure status "ci/circleci: e2e_tests" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@mmalerba
Copy link
Contributor

Caretaker note: causes a handful of failures in g3 due to assertions about tabindex that are no longer true

@crisbeto crisbeto force-pushed the 13953/checkbox-focus-redirect-resubmit branch from 64516ff to c22f5d0 Compare December 13, 2018 17:50
Currently the `mat-checkbox` host element isn't focusable, which means that if consumers decided to use something like `cdkFocusInitial` on it, nothing would happen. These changes tweak the `tabindex` so the element is focusable and add a `focus` listener that'll redirect focus to the `input`.

Relates to angular#13953.
@mmalerba
Copy link
Contributor

I think we probably don't want to do this, we've since discovered that its problematic for screen readers

@mmalerba mmalerba closed this Apr 17, 2019
@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
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants