bleep-cafe / bleep-cafe.github.io

12 stars 4 forks source link

🐛 ♿ Radio group doesn't get tab focus when selecting an option. #2

Open hayleigh-dot-dev opened 1 year ago

hayleigh-dot-dev commented 1 year ago

I'm trying to make sure as much of the interface is keyboard accessible as possible. To help achieve that, I've been making use of the Radix "headless" component library. These are unstyled components that have a bunch of thought put into accessibility, which is good because I am a big dumb dumb.

Unfortunately it looks like the radio group we've implemented doesn't capture focus properly, which I suppose is fine if you're only navigating with a keyboard but if you're navigating with a mouse I'd like for the control you're interacting with to get that focus.

Video below demonstrating the problem (I hope) because words are hard:

https://user-images.githubusercontent.com/9001354/203544869-a6a86992-d800-458d-b154-f0645b366f46.mov

This was definitely working early on, so I must've messed up something to break it.