vantezzen / auto-form

🌟 A React component that automatically creates a @shadcn/ui form based on a zod schema.
https://vantezzen.github.io/auto-form/
MIT License
2.75k stars 99 forks source link

onChange not getting fired on any field #66

Closed imprakharshukla closed 6 months ago

imprakharshukla commented 6 months ago

Hey! Awesome library, saves a bunch of time.

However, I am facing this issue while I am trying to display the photos selected by the user through a file input.

 fieldConfig={{
                images: {
                    description: "Upload images",
                    fieldType: "file",
                    inputProps: {
                        multiple: true,
                        accept: "image/*",
                        onChange: (e) => {
                            console.log({ e })
                        },
                    }
                },

onChange is not getting fired on this or any other field. How can I fix this?

cipriancaba commented 6 months ago

Have you tried to use onValuesChange on the AutoForm component directly?

imprakharshukla commented 6 months ago

That's what I have resorted to use for now.