Skip to content

Commit 10ccf12

Browse files
fix(Tooltip,Popover): account for shadowDOM target (#1769)
Ref #1691
1 parent b96f65a commit 10ccf12

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/TooltipPopoverWrapper.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ class TooltipPopoverWrapper extends React.Component {
162162
show(e) {
163163
if (!this.props.isOpen) {
164164
this.clearShowTimeout();
165-
this.currentTargetElement = e && e.currentTarget;
165+
this.currentTargetElement = e ? e.currentTarget || e.target : null;
166+
if (e && e.composedPath && typeof e.composedPath === 'function') {
167+
const path = e.composedPath();
168+
this.currentTargetElement = path && path[0] || this.currentTargetElement;
169+
}
166170
this.toggle(e);
167171
}
168172
}

0 commit comments

Comments
 (0)