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
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Today I accidentally found out that that it is not possible to clear the form of any input if that input is invalid.
In my understanding the form does not populate bound model unless it is valid. This way you can't reset bound model and expect invalid inputs to disappear. Because they are saved within forms's $inputValue. Setting form to pristine does not help with that either.
I think it should be either a part of form controllers $setPristine or a dedicated method such as $clearValues. Otherwise there's no way to clear invalid input.
And a quick demo (just type anything < 3 characters and try to discard changes):
Hi!
Today I accidentally found out that that it is not possible to clear the form of any input if that input is invalid.
In my understanding the form does not populate bound model unless it is valid. This way you can't reset bound model and expect invalid inputs to disappear. Because they are saved within forms's $inputValue. Setting form to pristine does not help with that either.
I think it should be either a part of form controllers $setPristine or a dedicated method such as $clearValues. Otherwise there's no way to clear invalid input.
And a quick demo (just type anything < 3 characters and try to discard changes):
and controller
The text was updated successfully, but these errors were encountered: