Skip to content

Commit 20d567f

Browse files
committed
fix(click): remove native click prevent 400ms later
When an actionsheet/popup is open, everything under it has `pointer-events:none`. However, once they are removed then the click prevent was removed immediately too, but the click that comes in 300ms later was still firing whatever would have been underneath the actionsheet/popup. Instead, wait 400ms before removing the click prevent, which would block the native click. Closes #2204
1 parent 6f79a5e commit 20d567f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: js/angular/service/actionSheet.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ function($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicP
119119

120120
scope.removed = true;
121121
sheetEl.removeClass('action-sheet-up');
122-
$ionicBody.removeClass('action-sheet-open');
122+
$timeout(function(){
123+
// wait to remove this due to a 300ms delay native
124+
// click which would trigging whatever was underneath this
125+
$ionicBody.removeClass('action-sheet-open');
126+
}, 400);
123127
scope.$deregisterBackButton();
124128
stateChangeListenDone();
125129

Diff for: js/angular/service/popup.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,11 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
398398
previousPopup.show();
399399
} else {
400400
//Remove popup-open & backdrop if this is last popup
401-
$ionicBody.removeClass('popup-open');
401+
$timeout(function(){
402+
// wait to remove this due to a 300ms delay native
403+
// click which would trigging whatever was underneath this
404+
$ionicBody.removeClass('popup-open');
405+
}, 400);
402406
$ionicBackdrop.release();
403407
($ionicPopup._backButtonActionDone || angular.noop)();
404408
}

0 commit comments

Comments
 (0)