Skip to content

Commit

Permalink
fix: check if target is connected before handling click outside
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljablonski committed Feb 10, 2024
1 parent e48db29 commit 758df51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ const Tooltip = ({
return
}
const target = event.target as HTMLElement
if (!target.isConnected) {
return
}
if (tooltipRef.current?.contains(target)) {
return
}
Expand Down

0 comments on commit 758df51

Please sign in to comment.