Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e742316

Browse files
committed
fix(input): Firefox validation trigger
Do not trigger Firefox validation on form initialization. - Do not set a value to an <input> field if the field already has the same value Closes #12102
1 parent 4bcf6c1 commit e742316

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ng/directive/input.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,11 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
11281128
element.on('change', listener);
11291129

11301130
ctrl.$render = function() {
1131-
element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);
1131+
// Workaround for Firefox validation #12102.
1132+
var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;
1133+
if (element.val() !== value) {
1134+
element.val(value);
1135+
}
11321136
};
11331137
}
11341138

0 commit comments

Comments
 (0)