-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing onParsedValuesChange function in AutoForm component #125
Comments
This doesn't currently exist because it sometimes worked unreliable - but I'll add it in the future. <AutoForm
onFormInit={(form) => {
form.watch((data) => {
const parsedData = schema.safeParse(data);
if (parsedData.success) {
onParsedValueChange(parsedData.data);
}
});
}}
/> |
Thank you, this is working good. |
Another question : I used the When I checked the data which is defined into args watch method, I didn't have a setting value as enum, like this: const schema = z.object({
"level": z.enum(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]).default("6")
})
<AutoForm
schema={new ZodProvider(schema)}
onFormInit={(form) => {
form.watch((data) => {
const parsedData = schema.safeParse(data);
if (parsedData.success) {
handleOnParserValuesChange(parsedData.data);
}
});
}}
/> Here the value into Does you have any idea, please ? Thank you in advance |
I don't think I fully understand you issue - I tried running this code but the values I got looked correct: https://codesandbox.io/p/sandbox/autoform-mui-demo-3pjwvr |
The same code does not work into my workspace. I do not know why. |
Ok I have the same issue but I can have a workaround like this const schema = z.object({
"level": z.enum(["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]).default("6")
})
<AutoForm
schema={new ZodProvider(schema)}
formProps={
onChange: (e) => {
console.log(e);
}
}
/> I do not know why I can have the good value like this and not with the method |
Hello,
I am working on the migration of AutoForm and I have this issue.
I used in my forms the attribute name
onParsedValuesChange
but it seems this attribute has disapeared.Could you please tell if we can use the same behavior with other attribute ?
I thank you in advance.
The text was updated successfully, but these errors were encountered: