-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Bug report
Current Behavior
React Select triggeres the onValueChange
event on render and the value is an empty string ''
Expected behavior
It shouldn't change the value by it's own
Reproducible example
Suggested solution
- not wrapping the select in
form
element - rendering the select even with no data
- not setting data on render
Additional context
to trigger the issue you should have this flow:
- the select is placed inside a form
- you should load data from somewhere and the select should not be rendered while loading the data
- when data is loaded you will show the select and set the value of it
if one of those conditions doesn't match, the issue will not appear
Your environment
Software | Name(s) | Version |
---|---|---|
Radix Package(s) | @radix-ui/react-select | 2.2.6 |
React | n/a | >=17 |
Browser | Edge | 141.0.3537.57 |
Assistive tech | NextJs and CRA | 15.5.2and 3.3.0 |
Node | n/a | 22 |
npm/yarn/pnpm | npm | 10.9.3 |
Operating System | Windows | 11 Pro |
JuliaAlaeva
Metadata
Metadata
Assignees
Labels
No labels