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
This all works great, except that I have to enter two characters into either of the TextInputs before getErrorsInField actually returns any error messages.
Stepping through the code I can see that the validate function is returning false straight away (i.e. after typing a single character), but this has no effect on getErrorsInField until another character is typed.
Is this intended behaviour? If so, why?! It seems to me as though anyone would expect errors to be returned immediately!
In any case, how can I fix this behaviour? MTIA 😄.
The text was updated successfully, but these errors were encountered:
export const validationMsgs = {
en: {
numbers: '{0} must be a valid number.',
email: '{0} must be a valid email address.',
required: '{0} is a required field.',
date: '{0} must be a valid date ({1}).',
minlength: '{0} length must be greater than {1}.',
maxlength: '{0} length must be lower than {1}.',
equalPassword: 'both password fields must match.',
hasUpperCase: '{0} must contain at least 1 uppercase letter.',
hasLowerCase: '{0} must contain at least 1 lowercase letter.',
hasNumber: '{0} must contain at least 1 digit.',
hasSpecialCharacter: '{0} must contain at least 1 special character.',
},
};
export const validationRules = {
emailAddress: { email: true, required: true },
password: {
minlength: 12,
hasNumber: true,
hasUpperCase: true,
hasLowerCase: true,
hasSpecialCharacter: true,
required: true,
},
};
Hi guys!
I have the following React context provider:
And the following consumer of this context:
This all works great, except that I have to enter two characters into either of the
TextInput
s beforegetErrorsInField
actually returns any error messages.Stepping through the code I can see that the
validate
function is returning false straight away (i.e. after typing a single character), but this has no effect ongetErrorsInField
until another character is typed.Is this intended behaviour? If so, why?! It seems to me as though anyone would expect errors to be returned immediately!
In any case, how can I fix this behaviour? MTIA 😄.
The text was updated successfully, but these errors were encountered: