-
Notifications
You must be signed in to change notification settings - Fork 3.4k
radio-group: no indication of focus when no option selected #11563
Description
Bug, enhancement request, or proposal: Bug
CodePen and steps to reproduce the issue:
Radio Button Demo which demonstrates the issue: Yes
Detailed Reproduction Steps:
- In the attached code pen focus the first input box
- Tab to the md-radio-group
What is the expected behavior?
I expect that there will be some indication of focus. In the docs there is a defined "focused state" for radio inputs.
What is the current behavior?
The current behavior is that there is no indication of focus.
What is the use-case or motivation for changing an existing behavior?
I am currently implementing a questionnaire that receives questions one by one. I would like to focus controls as they become available so users can select an option and hit enter to submit the form. This is not obvious if radio groups don't indicate focus.
Which versions of AngularJS, Material, OS, and browsers are affected?
- AngularJS: Latest
- AngularJS Material: Latest
- OS: All
- Browsers: All
Is there anything else we should know? Stack Traces, Screenshots, etc.
This is the archived material docs showing the "off / focused" radio buttons
I think the best solution to this problem while retaining a11y is to change how the arrow keys modify radio selections.
Currently focusing a radio group allows you to use the arrow keys to change the selected radio button. If we were to instead have the arrow keys change which radio button is focused and allow the enter key to change the selection. We could set the either the first radio button to focused given that no selection is made, or we could focus the selected radio button given that a selection has been made.
Now when focusing a radio group for the first time the first radio button would go into a focused state.
If a selection has already been made that radio would be selected + focused
I see a couple of closed tickets from long ago that sort of bring up this issue in a lot less detail, but they seem to have been closed without much explanation.
Now that the project is very much focused on a11y I am hoping this can be reconsidered. I am willing to spend some of my own time on this if the team decides this is an acceptable change.
Thanks!