-
-
Notifications
You must be signed in to change notification settings - Fork 124
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Summary 💡
Hej,
The components internally integrate with react hook form state using the useConroller hook, like this:
const { field, fieldState: { error } } = useController({ name, control, disabled: rest.disabled, rules: rulesTmp });
In our project, using the disabled flag causes two kinds of problems:
- The formState.isDirtyFlag is always true*
- The values of the disabled fields are not included on submit
Which breaks a lot of functionality. We may be able to work around it in a bigger refactoring, but it would be ideal if there was the option to opt out of this behaviour, like a flag for example "registerDisabled=true" which can be disabled on component configuration and then the useController would be intiialized without the disabled flag.
`* That seems to be related to this:
react-hook-form/react-hook-form#4740
PS:
I can help work on a pull request if you are willing to consider this feature. Thanks!
Examples 🌈
No response