mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 23:34:42 +00:00
fix(input): use apply on change event only when one isn't already in progress
Closes #5293
This commit is contained in:
parent
d158dd131e
commit
a80049fd0a
1 changed files with 2 additions and 6 deletions
|
|
@ -407,7 +407,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var listener = function(ev) {
|
var listener = function() {
|
||||||
if (composing) return;
|
if (composing) return;
|
||||||
var value = element.val();
|
var value = element.val();
|
||||||
|
|
||||||
|
|
@ -419,11 +419,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctrl.$viewValue !== value) {
|
if (ctrl.$viewValue !== value) {
|
||||||
// If an event was performed natively, jQuery sets the isTrigger property.
|
if (scope.$$phase) {
|
||||||
// When triggering event manually, the field is not present. Manually
|
|
||||||
// triggered events are performed synchronously which causes the "$digest
|
|
||||||
// already in progress" error.
|
|
||||||
if (ev && ev.isTrigger) {
|
|
||||||
ctrl.$setViewValue(value);
|
ctrl.$setViewValue(value);
|
||||||
} else {
|
} else {
|
||||||
scope.$apply(function() {
|
scope.$apply(function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue