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
This commit is contained in:
Adam Bradley
2014-09-15 00:00:59 -05:00
parent 6f79a5e5c8
commit 20d567f81c
2 changed files with 10 additions and 2 deletions

View File

@@ -119,7 +119,11 @@ function($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicP
scope.removed = true;
sheetEl.removeClass('action-sheet-up');
$ionicBody.removeClass('action-sheet-open');
$timeout(function(){
// wait to remove this due to a 300ms delay native
// click which would trigging whatever was underneath this
$ionicBody.removeClass('action-sheet-open');
}, 400);
scope.$deregisterBackButton();
stateChangeListenDone();

View File

@@ -398,7 +398,11 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
previousPopup.show();
} else {
//Remove popup-open & backdrop if this is last popup
$ionicBody.removeClass('popup-open');
$timeout(function(){
// wait to remove this due to a 300ms delay native
// click which would trigging whatever was underneath this
$ionicBody.removeClass('popup-open');
}, 400);
$ionicBackdrop.release();
($ionicPopup._backButtonActionDone || angular.noop)();
}