-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Behavior of disabled with input type=radio and option is unclear #7168
Comments
I have never stumbled over this with radio buttons, but I do have a use-case for the |
If this is meaningful behaviour, that the status of a disabled and selected option can be changed in a drop-down list or radio button group, then this should at least be described in the specification as an exception for disabled. I have not found anything about this in the specification. In addition, in deviation from the standard, it would then have to be regulated that not the checked radio button receives the keyboard focus, but the first radio button that is not disabled. Otherwise, the radio button group can be operated with the mouse, but not with the keyboard (the problem occurs in Firefox, but not in Chrome). |
The behavior is pretty clear from the spec, and not something we can change at this point given how many sites rely on the existing behavior. Perhaps an explanatory note would help clarify that disabled="" only prevents certain modifications, not all modifications (e.g. not programmatic modifications or indirect modifications of the sort you describe)? |
That would be good |
The problem is that a radio button that is checked and disabled can only be operated with the mouse (by clicking on other radio buttons in the group), but not with the keyboard, because the group does not receive the keyboard focus. This is therefore a serious violation of WCAG SC 2.1.1. The problem now occurs in Firefox, Chrome and Edge. |
In In However, I don't think there's anything in the HTML Standard that mandates the second input is not keyboard accessible however. So I don't see how this is an issue with HTML. |
@annevk Do I understand correctly that all browsers have a bug here because the disabled radio buttons do not receive focus with the keyboard? |
I just ran into the same problem. In this case, you will not be able to access the radio group from the keyboard. |
disabled
is actually intended to prevent an element from being operated. However, if a radiobutton is disabled and checked, it can be operated by activating another radiobutton that is in the same group (this is how Chrome and Firefox behave and I haven't found anything in the specification that explicitly forbids or allows this behavior).Possible solutions:
The same problem occurs with
<option>
in<select>
, where<option>
has the attributesselected
anddisabled
The text was updated successfully, but these errors were encountered: