You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue
Hi everyone, I would like to combine react hook form validation rules with date picker native validation (such as: invalid date, disableFuture ...), so that when I input invalid date from keyboard, the form will prevent submitting.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Versions
react-hook-form: 7.x
@mui/x-date-picker: 5.0.20
Issue
Hi everyone, I would like to combine react hook form validation rules with date picker native validation (such as: invalid date, disableFuture ...), so that when I input invalid date from keyboard, the form will prevent submitting.
This is my example sandbox:
https://codesandbox.io/s/tender-haibt-yltywf?file=/demo.tsx
In the above example, when I input the invalid date (validated by mui datepicker), I can still submit (expect prevent submitting).
I also think about
setError
or changing the controller rules, but I don't know what is the best solution for my case.Please help me if you know how to do it right. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions