question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support `onChange` and `onBlur` mode at the same time

See original GitHub issue

Is your feature request related to a problem? Please describe. The problem is what if I want my input to validate onBlur and onChange at the same time.

Describe the solution you’d like For instance, I want my field to validate right away after I remove focus on it (which is what onBlur is currently doing) plus when I input something on it, it will do also validate as well (which is what onChange was doing).

Describe alternatives you’ve considered With the mode property, I think we can pass an array of available modes or just a string.

useForm({
     mode: ['onChange', 'onBlur']
})

Sample: inputvalidation

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:33
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
bluebill1049commented, Mar 16, 2020

thankrs @rmlevangelio for the feature request. my suggestion:

useForm({
     mode: 'all'
})

will leave this issue for awhile, before move into back log.

3reactions
bluebill1049commented, May 3, 2020

will be shipped as part of V6

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-hook-form: Validation not working when using onBlur ...
1 Answer 1 ; onChange, string, Validation will trigger on the change event with each input, and lead to multiple re-renders. Warning: this...
Read more >
useForm | React Hook Form - Simple React forms validation
onBlur, string, Validation will trigger on the blur event. ; onChange, string, Validation will trigger on the change event with each input, and...
Read more >
HTML onchange Attribute - W3Schools
Definition and Usage. The onchange attribute fires the moment when the value of the element is changed. Tip: This event is similar to...
Read more >
Validation - Formik
Formik supports synchronous and asynchronous form-level and field-level ... the function runs, so you can validate dependent fields at the same time.
Read more >
SyntheticEvent - React
It has the same interface as the browser's native event, ... Pointer events are not yet supported in every browser (at the time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found