Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: clicking label doesn't select radio group if radio group has no current selection #942

Closed
fnimick opened this issue Nov 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working next

Comments

@fnimick
Copy link

fnimick commented Nov 18, 2024

Describe the bug

Rendering a RadioGroup with no value selected, and clicking the label, does not cause the group to select the associated element.

This appears to be caused by #927 - if you comment out the fix for #onFocus, this works.

In the provided example, I couldn't get styles working, but observe that clicking labels does nothing until a button is clicked, at which point label clicks work as expected.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-6hzbto?file=src%2Froutes%2F%2Bpage.svelte

Logs

No response

System Info

bits-ui @ 1.0.0-next.59

Severity

annoyance

@fnimick
Copy link
Author

fnimick commented Nov 18, 2024

Here's a wrinkle, based on how the radio group is implemented - is it possible to distinguish a focus event from a label click from a focus event caused by any other element? It appears that the focus event from label click is what causes label clicks to select under normal (already selected) circumstances.

@huntabyte huntabyte added bug Something isn't working next labels Nov 18, 2024
@huntabyte huntabyte self-assigned this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next
Projects
None yet
Development

No branches or pull requests

2 participants