Skip to content

Commit

Permalink
fix(autoclose): take into account inside 'touch' events on iOS (#3089)
Browse files Browse the repository at this point in the history
Fixes #3079
  • Loading branch information
maxokorokov committed Mar 28, 2019
1 parent ee1d723 commit 9e13e7f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/util/autoclose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ export function ngbAutoClose(

const shouldCloseOnClick = (event: MouseEvent | TouchEvent) => {
const element = event.target as HTMLElement;
if (event instanceof MouseEvent) {
if (event.button === 2 || isHTMLElementContainedIn(element, ignoreElements)) {
return false;
}
if ((event instanceof MouseEvent && event.button === 2) || isHTMLElementContainedIn(element, ignoreElements)) {
return false;
}
if (type === 'inside') {
return isHTMLElementContainedIn(element, insideElements);
Expand Down

0 comments on commit 9e13e7f

Please sign in to comment.