Skip to content

fix(material/radio): able to focus disabled radio button via click #15499

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

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

Fixes users being able to focus a disabled radio button by clicking on it. The issue comes from us preserving the -1 tabindex, even if the button is disabled.

Fixes #15493.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Mar 15, 2019
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 15, 2019
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 15, 2019
Along the same lines as angular#15499. Fixes the slide toggle being focusable via click when it's disabled.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 16, 2019
Along the same lines as angular#15499. Fixes the slide toggle being focusable via click when it's disabled.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Mar 18, 2019
Along the same lines as angular#15499. Fixes users being able to focus a disabled button toggle by clicking on it. The issue comes from us preserving the -1 tabindex, even if the button is disabled.
andrewseguin pushed a commit that referenced this pull request Mar 20, 2019
)

Along the same lines as #15499. Fixes the slide toggle being focusable via click when it's disabled.
andrewseguin pushed a commit that referenced this pull request Mar 25, 2019
)

Along the same lines as #15499. Fixes the slide toggle being focusable via click when it's disabled.
@jelbourn
Copy link
Member

As previously discussed, we should explore another way of dealing with the focus redirect for this component.

@mmalerba mmalerba added aaa and removed aaa labels Apr 25, 2019
crisbeto added a commit to crisbeto/material2 that referenced this pull request May 2, 2019
Along the same lines as angular#15499. Fixes users being able to focus a disabled button toggle by clicking on it. The issue comes from us preserving the -1 tabindex, even if the button is disabled.
@crisbeto crisbeto force-pushed the 15493/disabled-radio-focus branch from 2249e16 to 549e497 Compare May 2, 2019 06:25
@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label May 30, 2019
@crisbeto crisbeto force-pushed the 15493/disabled-radio-focus branch from 549e497 to 0792d7d Compare July 1, 2019 20:15
@crisbeto crisbeto force-pushed the 15493/disabled-radio-focus branch from 0792d7d to bb64336 Compare November 29, 2019 19:35
@crisbeto
Copy link
Member Author

@jelbourn do you remember the context behind figuring out a different approach to dealing with the focus redirect that you mentioned above? I think that this is still a problem which also ended up being transferred to the MDC-based radio button. I think that we should fix it, regardless of whether we decide to change the focus management afterwards.

crisbeto added a commit to crisbeto/material2 that referenced this pull request Feb 22, 2020
…tton via click

We have an existing fix for the regular radio button at angular#15499, but since it hasn't been merged yet, it got transferred to the MDC-based one.

Fixes users being able to focus a disabled radio button by clicking on it. The issue comes from us preserving the -1 tabindex, even if the button is disabled.
crisbeto added a commit to crisbeto/material2 that referenced this pull request Feb 22, 2020
…tton via click

We have an existing fix for the regular radio button at angular#15499, but since it hasn't been merged yet, it got transferred to the MDC-based one.

Fixes users being able to focus a disabled radio button by clicking on it. The issue comes from us preserving the -1 tabindex, even if the button is disabled.
jelbourn pushed a commit that referenced this pull request Feb 26, 2020
…tton via click (#18584)

We have an existing fix for the regular radio button at #15499, but since it hasn't been merged yet, it got transferred to the MDC-based one.

Fixes users being able to focus a disabled radio button by clicking on it. The issue comes from us preserving the -1 tabindex, even if the button is disabled.
jelbourn pushed a commit that referenced this pull request Mar 3, 2020
…tton via click (#18584)

We have an existing fix for the regular radio button at #15499, but since it hasn't been merged yet, it got transferred to the MDC-based one.

Fixes users being able to focus a disabled radio button by clicking on it. The issue comes from us preserving the -1 tabindex, even if the button is disabled.

(cherry picked from commit 7ba45d9)
@jelbourn
Copy link
Member

Adding tabindex="-1" to the host element makes some screen readers (particularly ChromeVox) treat both the host element and the internal input as controls that get read when using regular page navigation (not tab). This leads to the control's label being read twice.

@crisbeto crisbeto force-pushed the 15493/disabled-radio-focus branch from bb64336 to 3b9a7c8 Compare May 3, 2020 13:26
@crisbeto crisbeto changed the title fix(radio): able to focus disabled radio button via click fix(material/radio): able to focus disabled radio button via click Jan 10, 2021
Fixes users being able to focus a disabled radio button by clicking on it. The issue comes
from us preserving the -1 tabindex, even if the button is disabled.

Fixes angular#15493.
@crisbeto crisbeto force-pushed the 15493/disabled-radio-focus branch from 3b9a7c8 to ee208d4 Compare January 10, 2021 08:57
@crisbeto
Copy link
Member Author

Closing since this isn't necessary anymore, because we remove the tabindex from the host node.

@crisbeto crisbeto closed this Jun 22, 2021
@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 Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disabled radio button gets focus
5 participants