For email inputs, how to avoid the warning "Please include an @ ..." to show up right away?
#13267
Unanswered
binarykitchen
asked this question in
Q&A
Replies: 1 comment
-
|
You can't currently change the validation mode on a per-field basis in react-hook-form (see #13085, which has a status of "Pending Feature Requests"). This has been implemented in RHF Plus, which is intended to be a compatible replacement for react-hook-form with some additional opt-in features. See the docs. Disclaimer: I haven't used RHF-plus and I can't confirm how well that feature works. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For this email address input, I only typed
mand that warning already comes up right away which is quite annoying.I'm using react-hook-form while
shouldUseNativeValidationis set to true and the mode is set toonChange.And the React-based markup is
It's all legit. When you go to Mozilla, this doesn't happen there:
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/email
I understand, it's about the mode. Default is
onSubmit. Then this doesn't happen.But for some other form inputs, like changing and confirming passwords, I'd like to stick to
onChange.Would it be possible to define this mode by input base instead of form?
Beta Was this translation helpful? Give feedback.
All reactions