mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +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;
|
||||
var value = element.val();
|
||||
|
||||
|
|
@ -419,11 +419,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
|
|||
}
|
||||
|
||||
if (ctrl.$viewValue !== value) {
|
||||
// If an event was performed natively, jQuery sets the isTrigger property.
|
||||
// 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) {
|
||||
if (scope.$$phase) {
|
||||
ctrl.$setViewValue(value);
|
||||
} else {
|
||||
scope.$apply(function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue