-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Initially disabled inputs are not validated after enabled when form is submitted #9870
Comments
Reproduced, thanks. This issue seems to be related to #9753. For now, you can use the |
Indeed, if you replace |
I didn't check in details how are you using react hook form but I tried a basic example with react hook only and it was working fine |
@endrits079 we had issues in the past with a breaking change introduced by RHF in version 7.47.0 which affected disabled inputs. That's why we made sure the |
@endrits079 Any updates? |
using readonly indeed solved the issue, but introduced a new issue, because it was validating readonly fields so I had to change the validation logic to ignore readonly fields |
Fixed via #10163 |
What you were expecting:
I have a form with 2 inputs, both inputs are required but the second is disabled if there is no value for the first input, after I provide a value for the first input the second input becomes enabled but if I submit the form without providing a value for second input the form submission should failed because the required() should fail,
What happened instead:
The form was submitted and ignored the fact that there is no value on a required() validation input.
Steps to reproduce:
1.Go to create post,
Fill in the required fields but leave the average_note blank, it is required() and minimum 1 but it can submit the form without providing value for it
Related code:
https://stackblitz.com/edit/github-xm5t9q?file=src%2Fposts%2FPostCreate.tsx
The text was updated successfully, but these errors were encountered: