Skip to content

Commit

Permalink
fix(click): remove native click prevent 400ms later
Browse files Browse the repository at this point in the history
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
  • Loading branch information
adamdbradley committed Sep 15, 2014
1 parent 6f79a5e commit 20d567f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion js/angular/service/actionSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 5 additions & 1 deletion js/angular/service/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)();
}
Expand Down

0 comments on commit 20d567f

Please sign in to comment.