mobx-react-form icon indicating copy to clipboard operation
mobx-react-form copied to clipboard

.error ( and hasError) filled after clicking field without filling anything

Open aldarund opened this issue 7 years ago • 3 comments

E.g. i click field then click other field and the first field now has a error although i didnt enter anything yet Is it possible to display error only when user entered something? I tried to play with isPristine , isValid, hasError, focused properties without much luck. If i display based on isPristine and hasError - it work initially as i expect ( no error displayed when just clicking over fields). But then when i start to enter something a error immediately popin. If i add .focused to check the error wont appear after typing, but it will flash when going to next field.

aldarund avatar Jul 26 '17 00:07 aldarund

The errors depend on the validation rules/functions (for example, if you don't need to show an error when the input is empty, just don't use the required rule), or maybe you need to set the validateOnBlur or showErrorsOnBlur from option to false.

foxhound87 avatar Jul 27 '17 08:07 foxhound87

My answer helped? Maybe I don't get the point, can you elaborate this better?

foxhound87 avatar Aug 02 '17 17:08 foxhound87

showErrorsOnBlur:false worked for me :) Thanks @foxhound87.

andrefox333 avatar Nov 07 '18 19:11 andrefox333