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
Is your feature request related to a problem? Please describe.
Hi,
I have a custom validator that uses a target.
For example I got age field with rule required.
And second field that is select box and uses age as target for custom rule.
Lets say for example Confirm age with rule required|confirm:age
Now when i change the first age field that only has required rule. It also runs a validation for Confirm age field and marks this invalid. When there is big form with many fields and many refs the form starts to get very red even when you haven't filled half of it.
So on my example it runs required validation for Confirm age field. And prints error This field is required or something.
Describe the solution you'd like
I would like to disable the validation for ref.
Describe alternatives you've considered
I was thinking if i can edit my custom rule. But it wont be triggered.
Other alternative would be to create custom event that removes an error when second field does not have a value.
The text was updated successfully, but these errors were encountered:
I see the use case here. I would argue that instead of not validating when the target is changed, only validate the field if it has been manipulated by the user.
Validating the field again is necessary for the whole premise around the target-based or cross-field validation to work.
Slightly tweaking this to only validate the targets when they have been validated before (either manual by calling validate() or by user interaction) would make it acceptable for your use-case without risking incorrect validation state.
As a workaround, you could use or create rules similar to is which do not depend on cross-field validation, but on an actual value.
This PR forces the validation provider and the directive to not validate the cross-field targets until they have been interacted with or if validation was triggered manually at least once.
This solves the "aggressive" behavior when the user has only interacted with one of the two confirmed inputs for the first time.
closes#1902, closes#1869, closes#1765
Is your feature request related to a problem? Please describe.
Hi,
I have a custom validator that uses a target.
For example I got age field with rule
required
.And second field that is select box and uses age as target for custom rule.
Lets say for example Confirm age with rule
required|confirm:age
Now when i change the first age field that only has required rule. It also runs a validation for Confirm age field and marks this invalid. When there is big form with many fields and many refs the form starts to get very red even when you haven't filled half of it.
So on my example it runs required validation for Confirm age field. And prints error
This field is required
or something.Describe the solution you'd like
I would like to disable the validation for ref.
Describe alternatives you've considered
I was thinking if i can edit my custom rule. But it wont be triggered.
Other alternative would be to create custom event that removes an error when second field does not have a value.
The text was updated successfully, but these errors were encountered: