recharts icon indicating copy to clipboard operation
recharts copied to clipboard

Tooltip portal

Open PavelVanecek opened this issue 2 years ago • 2 comments

Description

This turned out to be easy now that tooltip is in context.

Related Issue

https://github.com/recharts/recharts/pull/4435

https://github.com/recharts/recharts/issues/2458

Motivation and Context

Make sure Tooltip always renders on top of other content, and Cursor always below

How Has This Been Tested?

tests, storybooks

Screenshots (if appropriate):

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have added tests to cover my changes.
  • [x] I have added a storybook story or extended an existing story to show my changes

PavelVanecek avatar Apr 17 '24 13:04 PavelVanecek

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.09%. Comparing base (dcb864b) to head (47f761d).

Additional details and impacted files
@@            Coverage Diff             @@
##              3.x    #4441      +/-   ##
==========================================
+ Coverage   95.04%   95.09%   +0.05%     
==========================================
  Files         106      107       +1     
  Lines       20723    20813      +90     
  Branches     2819     2846      +27     
==========================================
+ Hits        19696    19792      +96     
+ Misses       1021     1015       -6     
  Partials        6        6              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 17 '24 13:04 codecov[bot]

image Your description says the cursor is always below other content but it looks like it isn't from the storybook

ckifer avatar Apr 17 '24 23:04 ckifer

I think the screenshot is from build 863? I ran that one, then I realized I need to have a separate cursor portal, then I added the cursor portal. My bad, I should have generated a new diff, here it is: https://www.chromatic.com/test?appId=63da8268a0da9970db6992aa&id=66211568b767d61b79aa05d1

PavelVanecek avatar Apr 18 '24 12:04 PavelVanecek

For comparison here's a codesandbox I made on 2.x version - the tooltip wasn't clipped then. https://codesandbox.io/p/sandbox/tall-tooltip-739pqy?file=%2Fsrc%2FApp.tsx%3A62%2C16

PavelVanecek avatar Apr 18 '24 12:04 PavelVanecek

Sweet sorry, I could've found out post-merge. Thanks!

ckifer avatar Apr 18 '24 15:04 ckifer