Validation gets triggered on blur even the mode was set to 'onChange'
See original GitHub issueDescribe the bug
Hi, I just found a bug with the onChange mode. Validation gets triggered on blur even the mode was set to onChange
To Reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/react-hook-form-controller-1wurt
- Click on Uncontrolled input textbox (dont type anything)
- Remove the focus
- Error is shown
Codesandbox link (Required) https://codesandbox.io/s/react-hook-form-controller-1wurt
Expected behavior
Error should not be shown if the mode is onChange
because the user doesn’t perform any input changes. This should only happen if the mode is onBlur
Desktop (please complete the following information):
- OS: Mac OS Mojave
- Browser: chrome
- Version: 80.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Error validation after onBlur. Clear error onChange until the ...
Set the validation mode: "onBlur"; Clear the field's error onChange via clearErrors form method if there's an error.
Read more >react-hook-form: Validation not working when using onBlur ...
Validation will trigger on the blur event. Validation will trigger on the change event with each input, and lead to multiple re-renders.
Read more >Do not validate when typing, but on blur - Telerik UI for Blazor
Telerik UI for Blazor 2.30 adds a ValidateOn parameter to input components. It defines the event that triggers validation ( OnChange or OnInput...
Read more >react hook form onblur not working - You.com | The AI Search ...
In your code, the form mode is onBlur . it means the validation is triggered on blur event (unfocus the input). When you...
Read more >useForm | React Hook Form - Simple React forms validation
mode : onChange | onBlur | onSubmit | onTouched | all = 'onSubmit' ... to configure validation strategy when inputs with errors get...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
5.1.2-beta.1
here you go.no, not really. i will have to release a beta version for this.