Skip to content

Commit

Permalink
fix(Tooltip single target):Removed onClosed handler as it was redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
akhlesh committed Apr 21, 2019
1 parent 295aee1 commit d0c52c1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/TooltipPopoverWrapper.js
Expand Up @@ -85,7 +85,6 @@ class TooltipPopoverWrapper extends React.Component {
this.hide = this.hide.bind(this);
this.onEscKeyDown = this.onEscKeyDown.bind(this);
this.getRef = this.getRef.bind(this);
this.onClosed = this.onClosed.bind(this);
this.state = { isOpen: props.isOpen };
}

Expand Down Expand Up @@ -294,6 +293,7 @@ class TooltipPopoverWrapper extends React.Component {
if (newTarget !== this._targets) {
this.removeTargetEvents();
this._targets = newTarget ? Array.from(newTarget) : [];
this.currentTargetElement = this.currentTargetElement || this._targets[0];
this.addTargetEvents();
}
}
Expand All @@ -302,16 +302,12 @@ class TooltipPopoverWrapper extends React.Component {
if (this.props.disabled) {
return e && e.preventDefault();
}

return this.props.toggle(e);
}

onClosed() {
this.setState({ isOpen: false });
}

render() {
if (!this.state.isOpen) {
if (!this.props.isOpen) {
return null;
}

Expand Down Expand Up @@ -357,7 +353,6 @@ class TooltipPopoverWrapper extends React.Component {
modifiers={modifiers}
offset={offset}
cssModule={cssModule}
onClosed={this.onClosed}
fade={fade}
flip={flip}
>
Expand Down

0 comments on commit d0c52c1

Please sign in to comment.