Closed grmkris closed 4 months ago
I see the same behaviour @grmkris , did you end up fixing it?
Hey @vantezzen, happy to work on this, but I am not really sure how that onChange from the form
https://github.com/vantezzen/auto-form/blob/cff955854e5c4c62b2644edfba5720aa5fe41122/src/components/ui/auto-form/index.tsx#L65 gets triggered. It seems to be triggering prematurely with the old values as @grmkris mentioned
Triggering any state update in any other regular field will correctly update the values.
Would have expected onValuesChange
to somehow use the watch
functionality of react hook form
Great - that form onChange event is simply the propagated onChange events from the input fields. I originally implemented it like that so the change logic is implemented centrally and the field components don't need to care about that. Feel free to refactor this if it's better implemented another way!
i am using zod.enum and when renderng the