Skip to content

Commit 9d1dbd5

Browse files
committed
refactor(input): remove $$parserName from email, url
Since email and url don't use $parsers, we do not need to set the parserName. This also reduces the number of times the valid / invalid classes are set within for the input or possible parent forms. This was discovered when fixing angular#14249. The additional class settings triggered a cancellation of the structural animation. A general fix for this behavior has landed as <insert commit here>
1 parent 82a4545 commit 9d1dbd5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/ng/directive/input.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1440,20 +1440,18 @@ function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
14401440
baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14411441
stringBasedInputType(ctrl);
14421442

1443-
ctrl.$$parserName = 'url';
14441443
ctrl.$validators.url = function(modelValue, viewValue) {
14451444
var value = modelValue || viewValue;
14461445
return ctrl.$isEmpty(value) || URL_REGEXP.test(value);
14471446
};
14481447
}
14491448

14501449
function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
1451-
// Note: no badInputChecker here by purpose as `url` is only a validation
1450+
// Note: no badInputChecker here by purpose as `email` is only a validation
14521451
// in browsers, i.e. we can always read out input.value even if it is not valid!
14531452
baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
14541453
stringBasedInputType(ctrl);
14551454

1456-
ctrl.$$parserName = 'email';
14571455
ctrl.$validators.email = function(modelValue, viewValue) {
14581456
var value = modelValue || viewValue;
14591457
return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);

0 commit comments

Comments
 (0)