Skip to content

Commit

Permalink
fix: Prevent popover/tooltip rendering if target not resolved (reacts…
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang committed Dec 28, 2020
1 parent f18351b commit de06e9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TooltipPopoverWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ class TooltipPopoverWrapper extends React.Component {
this.updateTarget();
}

const target = this.currentTargetElement || this._targets[0];
if (!target) {
return null;
}

const {
className,
cssModule,
Expand Down Expand Up @@ -360,7 +365,7 @@ class TooltipPopoverWrapper extends React.Component {
return (
<PopperContent
className={className}
target={this.currentTargetElement || this._targets[0]}
target={target}
isOpen={isOpen}
hideArrow={hideArrow}
boundariesElement={boundariesElement}
Expand Down

0 comments on commit de06e9f

Please sign in to comment.