Closed gldiazcardenas closed 9 months ago
Yes, I can see that as useful, if checks are not .immediate().
Implementation would require a clear method in Validator, which in turn calls a clear method of all Checks which would then remove all decorations.
It must also set a new, empty ValidationResult.
One question remains: What do we do, if checks are immediate? Should a recheck happen for them? Or would it be better to not "touch" them until the user does? In that way a hybrid mode could be implemented where checks are immediate but only after the user changed the value once ...
actually the immediate mode is a topic for further discussion.. nobody likes a red form right after opening it.. another use case I could think about clear() method is when you let the user copy values from external sources, for example, loading a file, or copy from another object; but the submit button might have already been clicked, so you want to clear all validations.
A clear() method has been added to both Check and Validator class. This will be part of the upcoming 0.5.0 release.
It could be useful to clear up all decorations and start over.