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 has been archived by the owner on Sep 8, 2020. It is now read-only.
Leave the box empty, change dropdown from "Everyday" to "Cancel"
Expected behavior:
$scope.testForm.$error is an empty object.
Both "min" and "required" rules disappear from it
Since the field is disabled, no validation rules should be placed on it
Actual behavior:
$scope.testForm.$error is not an empty object.
"required" rule disappears as is standard for validation of disabled fields in angular.
"min" is still listed in the $scope.testForm.$error obj. It shouldn't be there. Once the field is disabled, no validation should be taking place on it, thus there should be nothing in the $error object
The reason you see the required rule disappear is because you have ng-required make it not required when cancelled. This has nothing to do with the input disabled state.
If you change it to just required="true" you will see that the rule still applies even if it is disabled. Its not documented that disabling a field should remove its validation constraints.
The issue can be seen in this plunker:
https://plnkr.co/edit/pbLlYkCVTSo1HV8KiXB2?p=preview
The text was updated successfully, but these errors were encountered: