Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active bar and tooltip persist despite mouse cursor leaving chart area #4466

Open
1 task done
robmorieson opened this issue Apr 30, 2024 · 4 comments
Open
1 task done
Labels
bug General bug label

Comments

@robmorieson
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • Navigate to the provided reproduction link
  • Hover the mouse cursor over the bars within the chart
  • Move the cursor back outside of the chart area
  • Repeat this action until a bar remains in an active state despite the mouse no longer hovering over the chart

What is expected?

The active bar and tooltip should only be visible while actively hovering over a bar.

What is actually happening?

The active bar and tooltip persist even when the mouse cursor is no longer hovering over the chart.

Environment Info
Recharts v2.12.6
React 18.0.0
System MacOS
Browser Chrome 124.0.6367.91 (Official Build) (arm64)

@ckifer ckifer added the bug General bug label label Apr 30, 2024
@ckifer
Copy link
Member

ckifer commented Apr 30, 2024

It would be nice if there was an always-reproducable reason for this as it took me quite some time to have happen to me.

I also cannot reproduce in Firefox, only Chrome.

@HHongSeungWoo any thoughts since I think you dealt with this before with active tooltip a little bit?

@benschwarz
Copy link

Confirming, I observed the bug, only in Chrome. Not in Firefox.

@ckifer
Copy link
Member

ckifer commented May 1, 2024

Weird..

@HHongSeungWoo
Copy link
Member

It appears that the mouseout and mouseleave events are not being received due to component re-rendering.
I think we need to delegate the handling of mouse events to the parent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug General bug label
Projects
None yet
Development

No branches or pull requests

4 participants