diff --git a/src/TooltipPopoverWrapper.js b/src/TooltipPopoverWrapper.js index 2d3783a65..29f8feeed 100644 --- a/src/TooltipPopoverWrapper.js +++ b/src/TooltipPopoverWrapper.js @@ -82,14 +82,19 @@ class TooltipPopoverWrapper extends React.Component { this.getRef = this.getRef.bind(this); this.onClosed = this.onClosed.bind(this); this.state = { isOpen: props.isOpen }; + this._isMounted = false; } componentDidMount() { + this._isMounted = true; this.updateTarget(); } componentWillUnmount() { + this._isMounted = false; this.removeTargetEvents(); + this.clearShowTimeout(); + this.clearHideTimeout(); } static getDerivedStateFromProps(props, state) { @@ -279,7 +284,7 @@ class TooltipPopoverWrapper extends React.Component { } toggle(e) { - if (this.props.disabled) { + if (this.props.disabled || !this._isMounted) { return e && e.preventDefault(); }