diff --git a/src/ngTouch/directive/ngClick.js b/src/ngTouch/directive/ngClick.js index 90274aba7322..e28d4a6a032c 100644 --- a/src/ngTouch/directive/ngClick.js +++ b/src/ngTouch/directive/ngClick.js @@ -227,10 +227,6 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', touchStartY = e.clientY; }); - element.on('touchmove', function(event) { - resetState(); - }); - element.on('touchcancel', function(event) { resetState(); }); diff --git a/test/ngTouch/directive/ngClickSpec.js b/test/ngTouch/directive/ngClickSpec.js index 921c64578b2b..543ff69cd9b9 100644 --- a/test/ngTouch/directive/ngClickSpec.js +++ b/test/ngTouch/directive/ngClickSpec.js @@ -97,7 +97,7 @@ describe('ngClick (touch)', function() { })); - it('should not click if a touchmove comes before touchend', inject(function($rootScope, $compile, $rootElement) { + it('should still click if a touchmove comes before touchend', inject(function($rootScope, $compile, $rootElement) { element = $compile('
')($rootScope); $rootElement.append(element); $rootScope.$digest(); @@ -112,11 +112,11 @@ describe('ngClick (touch)', function() { browserTrigger(element, 'touchmove'); browserTrigger(element, 'touchend',{ keys: [], - x: 400, - y: 400 + x: 10, + y: 10 }); - expect($rootScope.tapped).toBeUndefined(); + expect($rootScope.tapped).toBe(true); })); it('should add the CSS class while the element is held down, and then remove it', inject(function($rootScope, $compile, $rootElement) {