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.
The problem is with input[number] field. When i change value to invalid and uncheck checkbox field should reset value to last valid one and thus there should be no validation error. View value is changed back but validation value is still present.
By digging some into angular, whole problem seems to be automatically added "badInputChecker" $parser. It checks element ValidityState without respect to new value and in consequence returns undefined to model.
Workaround could be before $setViewValue() to set new value for input and perform checkValidity():
// Set new input value and do checkValidity() that updates input ValidityState
var tmp = input.val();
input.val(valid);
input[0].checkValidity()
input.val(tmp);
// Do standard angular $setViewValue()
inputCtrl.$setViewValue(valid);
inputCtrl.$render();
Any ideas or plans how can this be solved in angularjs?
The problem is with input[number] field. When i change value to invalid and uncheck checkbox field should reset value to last valid one and thus there should be no validation error. View value is changed back but validation value is still present.
See the demo: http://plnkr.co/edit/qIFxmVEXowSNGaBifV4T?p=preview
By digging some into angular, whole problem seems to be automatically added "badInputChecker" $parser. It checks element ValidityState without respect to new value and in consequence returns undefined to model.
Workaround could be before $setViewValue() to set new value for input and perform checkValidity():
Any ideas or plans how can this be solved in angularjs?
Cheers,
Edvinas