iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.12k stars 1.12k forks source link

Radio buttons need to be grouped for proper interaction #71

Open chris-morgan opened 4 years ago

chris-morgan commented 4 years ago

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.

hecrj commented 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.

breynard0 commented 3 months ago

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.