jwstegemann / fritz2

Easily build reactive web-apps in Kotlin based on flows and coroutines.
https://www.fritz2.dev
MIT License
636 stars 25 forks source link

Make Headless RadioGroups focusable out-of-the-box #770

Closed Lysander closed 5 months ago

Lysander commented 1 year ago

Currently a component based upon headless radioGroups cannot be focused unless one element is selected. This behavior seems to be at least debateable: When tabbing through some complex form group, one should be able to tab into every control of this group imho.

So it would be a nice to set a tabindex(0) on each radioGroupOption element by default, if there is no selection at all.

The current code does not analyze, if there is a selection or not. This should get fixed.

Of course this can be overruled by the user just like almost all other defaults in case he do not want to focus an unselected radioGroup.