-
Notifications
You must be signed in to change notification settings - Fork 47
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
Make radiobutton focusable #625
Conversation
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for the team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
I think the radiobutton need Furthermore I think there should also be a checkbox group as it is possible to add |
Hi @bjarnef Thanks for your attention to these details. I agree that this is a problem "which means it isn't focusable when none of the radio buttons are checked." I'm not sure why you outcommented that. Which leads me to having a hard time seeing how this PR actually changes/fixes anything with keyboard navigation, cause it does not change anything regarding keyboard navigation on my end. I do see that you cleaned up a bit and fixed the styling for the disabled state. But then this should not be linked with the Issue any more? Because we should not accidentally close the issue when closing this PR. Let me know if I'm not right about that this does not fix or change keyboard navigation. Thanks :-) |
@nielslyngsoe I originally worked on making the radiobutton focusable here: https://uui.umbraco.com/?path=/story/uui-radio--aaa-overview but I then noticed is causes issues with a radiobutton group https://uui.umbraco.com/?path=/story/uui-radio--radio-group where it set but it also meant that for a single radiobutton it has If I change to This also seemed to be a be inconsistent for checkbox, because it doesn't set the The |
@bjarnef I have changed your PR description so it does not reference the issue any longer as this does not fix the keyboard navigation. also there is linting issues with this one, so it would be nice if you could run the npm run lint:fix script on this branch. Thanks |
@bjarnef this seems close to be ready for merge. Would you like to finish it of and then I will do a final review and get it in? Or do you want me to take it from here? |
@nielslyngsoe you are welcome to take a look. I also find some inconsistency because radiobutton allow to set I would like it the |
@bjarnef I had one of our Developers looking at this, as well as my self. And I have to be honest it is really hard to review this type of PR where you combine a few things. As well you described somethings that I cant find in the code changes. I completely agree with your goal. So to make it easier to review, I will ask you to split this into individual PRs. with a clear description of "The problem", "The solution", and "Steps to reproduce the problem". Cause the problem with this PR is that we can't see any difference and we dont know what exactly to look for. |
Description
Not sure why the radiobutton is different from checkbox and settabindex="-1"
which mean it isn't focusable when none of the radiobuttons are checked.So it wasn't possible to set focus on radiobutton and check this via space key.
It seems there a single radiobutton isn't focusable because of
tabindex="-1"
on host element unlike checkbox, but use in radiobutton group to focus only a single element (first or selected item).I think much of the styling could be cleaned up (maybe there should be some base styling to import, so we don't need to write the same CSS regarding much of the custom outline styling).
In both radiobutton and checkbox (extending boolean input) the structure is like the following:
Types of changes
Motivation and context
How to test?
Screenshots (if appropriate)
Checklist