Skip to content

Commit

Permalink
Use getBoundingClientRect as a fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
s77rt committed Oct 12, 2023
1 parent f84bf6a commit 7fdbe50
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/Tooltip/BaseTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ function chooseBoundingBox(target, clientX, clientY) {
}
}

// If no matching bounding box is found, fall back to the first one.
// This could only happen if the user is moving the mouse very quickly
// and they got it outside our slop above.
return bbs[0];
// If no matching bounding box is found, fall back to getBoundingClientRect.
return target.getBoundingClientRect();
}

function Tooltip({children, numberOfLines, maxWidth, text, renderTooltipContent, renderTooltipContentKey, shouldHandleScroll, shiftHorizontal, shiftVertical}) {
Expand Down

0 comments on commit 7fdbe50

Please sign in to comment.