Skip to content

Commit

Permalink
fix: wrong target (#914)
Browse files Browse the repository at this point in the history
the following fix of #913

in `onDocumentPress`, the check for `event.target` should all be replaced with `actualTarget`.
  • Loading branch information
zhaoyao91 committed Mar 2, 2021
1 parent 3fe61fc commit 0d8acf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/createTippy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,9 @@ export default function createTippy(
}
}

// Clicked on interactive popper
const actualTarget = (event.composedPath && event.composedPath()[0]) || event.target;

// Clicked on interactive popper
if (
instance.props.interactive &&
popper.contains(actualTarget as Element)
Expand All @@ -310,7 +311,7 @@ export default function createTippy(
}

// Clicked on the event listeners target
if (getCurrentTarget().contains(event.target as Element)) {
if (getCurrentTarget().contains(actualTarget as Element)) {
if (currentInput.isTouch) {
return;
}
Expand Down

0 comments on commit 0d8acf2

Please sign in to comment.