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.
There's a bug with updating view values when an input of type email contains invalid content and its model is an objects' property.
A practical example is resetting an object using angular.copy with an empty object, like it's done in most examples in the Developer Guide, Chapter "Forms" (https://docs.angularjs.org/guide/forms).
The reason this happens, is that email inputs don't get their model values updated, if the content is invalid. Later when a model change happens, NgModelController determines the value via ngModelGet($scope); and compares this to ctrl.$modelValue (see this line:
Both are undefined, in case you didn't enter any valid input before, and therefore the view value is not updated.
If noticed ctrl.$dirty is set to true, on the line above, so a simple fix could be to also ask if $dirty is true. But I can't estimate the performance hit, and can't help with tests as I'm still pretty new to angular internals.
Please help and verify, or tell me if I got something wrong.