Closed norayr93 closed 10 months ago
I think because of the Select.Root
API is onValueChange
, not onChange
so you have to manually handle it instead of spreading props from the validation library
@ng-hai Then how is it supposed to be uncontrolled?
how did you fix this? @norayr93
This is how I use with react-hook-form
Bug report
Current Behavior
I have a Remix form in combination with
@conform-to/zod
and@conform-to/react
. I am implementing client-side validation. I am using the first example in your docsWhen I first submit the form, it properly shows the validation error for the Select field. After that, once I start to change the Select and pick one of the options, the validation error is still there as no event is triggered and no re-render happens. The value on the Select is changed, but only internally and not handling the internal
select
with aria-hidden={true}.Expected behavior
In the docs, it's clearly mentioned it has a support of
Uncontrolled component
. The expected behavior is that whenever we change the Select and pick an option ( In this case the required constraint is satisfied ), the form should get that value, and revalidation should happen and remove the error message.FYI - html select works as expected.