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

Changes from PR review:
  o  Small tidyup.
  • Loading branch information
ewanmellor committed Sep 21, 2023
1 parent f21c41c commit b2000cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/Tooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,11 @@ function Tooltip(props) {
if (bounds.width === 0) {
setIsRendered(false);
}
const t = target.current;
// Choose a bounding box for the tooltip to target.
// In the case when the target is a link that has wrapped onto
// multiple lines, we want to show the tooltip over the part
// of the link that the user is hovering over.
const betterBounds = chooseBoundingBox(t, initialMousePosition.current.x, initialMousePosition.current.y);
const betterBounds = chooseBoundingBox(target.current, initialMousePosition.current.x, initialMousePosition.current.y);
setWrapperWidth(betterBounds.width);
setWrapperHeight(betterBounds.height);
setXOffset(betterBounds.x);
Expand Down

0 comments on commit b2000cd

Please sign in to comment.