-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Bug report
According to the latest main (as of 05.11.2025)
| onValueChange?(value: string): void; |
onValueChange handler has onValueChange?(value: string): void; type.However, RadixToggle allows deselecting currently active selected element which means the handler provides
undefined value, which is not listed in the handler arguments.
Current Behavior
onValueChange?(value: string): void; provides undefined value in some cases
Expected behavior
onValueChange?(value?: string): void; or onValueChange?(value: string | undefined): void;
Reproducible example
Not needed - the example for deselecting and how to deal with it (e.g. ensuring selection) listed in https://www.radix-ui.com/primitives/docs/components/toggle-group#ensuring-there-is-always-a-value
Suggested solution
Update the type definition
Additional context
N/A
Your environment
N/A
| Software | Name(s) | Version |
|---|---|---|
| Radix Package(s) | @radix-ui/react-toggle-group | ^1.1.10 |
Metadata
Metadata
Assignees
Labels
No labels