Skip to content

Conversation

@brunnerh
Copy link
Contributor

@brunnerh brunnerh commented Jan 3, 2024

Also make radio button group name a required property (can change this again, if there is a good reason not to do this).

Unfortunately the change event does only fire for the newly selected radio button, not for the ones that are automatically unselected; this is why I used document.getElementsByName to find the associated ones.

Fixes #1879.

Make radio button group `name` a required property.
@brunnerh
Copy link
Contributor Author

brunnerh commented Jan 3, 2024

Also make radio button group name a required property (can change this again, if there is a good reason not to do this).

The skeleton UIs might be a good reason 🤔.

<RadioButtonGroup legendText="Storage tier (disk)" name="skeleton">
  <RadioButtonSkeleton />
  <RadioButtonSkeleton />
  <RadioButtonSkeleton />
</RadioButtonGroup>

@metonym
Copy link
Collaborator

metonym commented Oct 20, 2025

@brunnerh Happy to revisit this. In the context of implementing #2225, what does this PR do?

@brunnerh
Copy link
Contributor Author

It synchronizes the checked state across members of the implicit radio button group.
See comments on your recent PR.

@metonym
Copy link
Collaborator

metonym commented Oct 20, 2025

Why does it need to use the DOM to do this? Why can't RadioButtonGroup handle this?

@brunnerh
Copy link
Contributor Author

brunnerh commented Oct 20, 2025

Because there is no RadioButtonGroup, this is specifically about usage without that component, e.g. because the radio buttons are far apart with other UI in-between. RadioButtonGroup does not just provide context, it also does layout (which arguably maybe it should not do in the first place).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RadioButton checked doesn't change

2 participants