Open chris-morgan opened 4 years ago
Yes, I agree.
This should also improve their API and ensure you cannot use them as a multiselection widget, where checkboxes would make more sense.
The main challenge here, in the long run, will be styling flexibility.
We could have something like a RadioButtonContainer
, which can use Rust builder syntax to place in radio buttons. An issue I can see is that if someone wants an unconventional radio button layout it could get tricky, but I feel like it's possible to work around that.
Radio buttons should always belong to a group, so that things like the arrow keys work to select a different value, and so that accessibility tools can understand what’s going on with them.
In HTML, this means that grouped radio buttons need to share a
name
attribute.