radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
14.82k stars 717 forks source link

Select components #2944

Open bizmich opened 3 weeks ago

bizmich commented 3 weeks ago

Radix UI Select's onValueChange runs on rendering without even changing anything, therefore it clears the default value that was passed with react-hook-form.

vladmoroz commented 3 weeks ago

Could you elaborate with a CodeSandbox example of the problem?

bizmich commented 3 weeks ago

Could you elaborate with a CodeSandbox example of the problem? image

Here you can see that editing any item happens, so I tried to assign data from the backend. When this assignment happens and the value of currencyType changes, the onValueChange function executes. I hope I explained it well.

vladmoroz commented 3 weeks ago

We'd really need a minimal reproduction to help here