Skip to content

fix: avoid invalid label/button nesting in switch#571

Merged
jrasm91 merged 1 commit intomainfrom
fix/switch-label-wrapping
Feb 4, 2026
Merged

fix: avoid invalid label/button nesting in switch#571
jrasm91 merged 1 commit intomainfrom
fix/switch-label-wrapping

Conversation

@michelheusschen
Copy link
Collaborator

@michelheusschen michelheusschen commented Feb 4, 2026

Nesting this switch inside a <label> is invalid HTML because bits-ui renders the switch internally as a button, and a label shouldn’t wrap an interactive element. In Firefox, clicking the label can either do nothing or behave unpredictably by toggling adjacent switches.

The fix is to render the label/description alongside Switch.Root instead of wrapping it. I tested this in Immich Web, but I’m not sure whether this component is used elsewhere.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📖 Preview of ui.immich.app deployed to ui.pr-571.dev.immich.app

@jrasm91
Copy link
Member

jrasm91 commented Feb 4, 2026

Thanks! And welcome back! 😁

@jrasm91 jrasm91 merged commit 70a561b into main Feb 4, 2026
8 checks passed
@jrasm91 jrasm91 deleted the fix/switch-label-wrapping branch February 4, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants