Skip to content

Commit

Permalink
Fix: Chat - Link in end of line displays tooltip over text and not on…
Browse files Browse the repository at this point in the history
… link

Change from PR review: move the onMouseEnter / onMouseLeave callbacks
before the setIsHovered calls.
  • Loading branch information
ewanmellor committed Sep 21, 2023
1 parent b2000cd commit 3dc42e9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Hoverable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,23 @@ class Hoverable extends Component {
}
},
onMouseEnter: (el) => {
this.setIsHovered(true);

if (_.isFunction(this.props.onMouseEnter)) {
this.props.onMouseEnter(el);
}

this.setIsHovered(true);

if (_.isFunction(child.props.onMouseEnter)) {
child.props.onMouseEnter(el);
}
},
onMouseLeave: (el) => {
this.setIsHovered(false);

if (_.isFunction(this.props.onMouseLeave)) {
this.props.onMouseLeave(el);
}

this.setIsHovered(false);

if (_.isFunction(child.props.onMouseLeave)) {
child.props.onMouseLeave(el);
}
Expand Down

0 comments on commit 3dc42e9

Please sign in to comment.