Focus states don't work on checkbox inputs
See original GitHub issueWhat you were expecting: WHen navigating through the CheckboxGroupInput inputs, there should be a visible indicator when using the TAB key
What happened instead: No way to indicate which of the checkboxes is focused
Steps to reproduce: Navigate to the post page Tab through the page Observe the lack of styles on focus
This is likely due to the styles being applied to the focus
pseudo class of the span
element. But the span
element isn’t focusable via keyboard. Instead we should leverage the focus-within
pseudo class to display focus styles if the child input
element is focused
I can create a quick PR for this
insert short code snippets here
Other information:
Environment
- React-admin version:
- Last version that did not exhibit the issue (if applicable):
- React version:
- Browser:
- Stack trace (in case of a JS error):
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to remove focus outline on clicked checkbox, but not ...
I only want to show the focus state when it's keyboard navigated to. How do I remove the focus state if clicked on?...
Read more >Checkbox - UI Playbook
#Focus state ... Indicates that the focus in the document is currently on the checkbox. For the sake of aesthetics, it can be...
Read more >focus-visible - CSS: Cascading Style Sheets - MDN Web Docs
The :focus-visible pseudo-class applies while an element matches the :focus pseudo-class and the UA (User Agent) determines via heuristics ...
Read more >Don't style :checked and :focus states identically - here's why
In the first set of checkboxes, "checked" and "focus" states are identical in style. If the checkbox is already checked ('Choice 1' is,...
Read more >How to handle HTML checkbox events | HTML Form Guide
Now what we need to do is to attach an event to the checkbox so it checks its state each time it's changed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If the cause is the disableRipple (which we added for performance reasons), then we should remove this disableRipple, and let developers looking for performance re-add it in userland if they want.
Thanks for your report and for the fix you have provided!