Closed MusabDev closed 11 months ago
Add onValueChanges and defaultValues will change your selection
`
<SelectContent>
<SelectItem value="Islam">Islam</SelectItem>
<SelectItem value="Christian">Christian</SelectItem>
<SelectItem value="Jew">Jew</SelectItem>
<SelectItem value="Hindu">Hindu</SelectItem>
<SelectItem value="Sikh">Sikh</SelectItem>
</SelectContent>
</Select>
</FormControl> `
Instead of spreading the props from react-hook-form directly, I added those manually. And it fixed the problem.
You can check the example here: https://ui.shadcn.com/docs/components/select
<Select
onValueChange={field.onChange}
value={field.value}
disabled={field.disabled}
>
Hello, I have a sheet with select component used inside it. But when I try to change value in select component, it doesn't let me do that.
Code to reproduce the issue:
Video: https://github.com/shadcn-ui/ui/assets/83802666/1797c0dd-2810-40e4-99b3-93f735570997