Skip to content

Commit

Permalink
fix(input): use apply on change event only when one isn't already in …
Browse files Browse the repository at this point in the history
…progress

Closes angular#5293
  • Loading branch information
IgorMinar authored and jamesdaily committed Jan 27, 2014
1 parent c206253 commit 2a36b5c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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() {
Expand Down

0 comments on commit 2a36b5c

Please sign in to comment.