From c235450503d7e71d66f4ba1a73984bd13b976678 Mon Sep 17 00:00:00 2001 From: Mike Calvanese Date: Sat, 28 Feb 2015 15:36:09 -0500 Subject: [PATCH] fix(ngTouch): don't blur form elements Form element focus should not be prevented by ng-click. The issue was introduced by #2989, and happens on mobile browsers that support touch events. Plunker to demonstrate the issue: http://embed.plnkr.co/CxeuWocoPE70vzrevrIi Closes #4030, #6432 --- src/ngTouch/directive/ngClick.js | 3 --- test/ngTouch/directive/ngClickSpec.js | 12 ------------ 2 files changed, 15 deletions(-) diff --git a/src/ngTouch/directive/ngClick.js b/src/ngTouch/directive/ngClick.js index f352c252f443..ec8c4cf99cde 100644 --- a/src/ngTouch/directive/ngClick.js +++ b/src/ngTouch/directive/ngClick.js @@ -158,9 +158,6 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', // If we didn't find an allowable region, bust the click. event.stopPropagation(); event.preventDefault(); - - // Blur focused form elements - event.target && event.target.blur && event.target.blur(); } diff --git a/test/ngTouch/directive/ngClickSpec.js b/test/ngTouch/directive/ngClickSpec.js index 179b0248ff21..9d37f7b4d056 100644 --- a/test/ngTouch/directive/ngClickSpec.js +++ b/test/ngTouch/directive/ngClickSpec.js @@ -314,18 +314,6 @@ describe('ngClick (touch)', function() { expect($rootScope.count1).toBe(1); - time = 90; - // Verify that it is blured so we don't get soft-keyboard - element1[0].blur = jasmine.createSpy('blur'); - browserTrigger(element1, 'click',{ - keys: [], - x: 10, - y: 10 - }); - expect(element1[0].blur).toHaveBeenCalled(); - - expect($rootScope.count1).toBe(1); - time = 100; browserTrigger(element1, 'touchstart',{ keys: [],