diff --git a/src/mask.js b/src/mask.js index 052eabc..1f0a494 100644 --- a/src/mask.js +++ b/src/mask.js @@ -444,12 +444,14 @@ angular.module('ui.mask', []) if (!isValid || value.length === 0) { valueMasked = ''; iElement.val(''); - scope.$apply(function() { - //only $setViewValue when not $pristine to avoid changing $pristine state. - if (!controller.$pristine) { - controller.$setViewValue(''); - } - }); + if (!scope.$$phase) { + scope.$apply(function() { + //only $setViewValue when not $pristine to avoid changing $pristine state. + if (!controller.$pristine) { + controller.$setViewValue(''); + } + }); + } } } //Check for different value and trigger change.