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

Enable CSS transition for sectors on hover in PieChart with isAnimationActive as true #4216

Open
1 task done
beltranrengifo opened this issue Feb 21, 2024 · 3 comments
Open
1 task done
Labels
bug General bug label enhancement Enhancement to a current API

Comments

@beltranrengifo
Copy link

beltranrengifo commented Feb 21, 2024

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • if isAnimationActive is true, hover any sector, check the fill transition is not applied
  • if isAnimationActive is false, hover any sector, check the fill transition is applied

What is expected?

the fill transition works in both cases

What is actually happening?

the fill transition only works if isAnimationActive is false

Environment Info
Recharts v2.12.1
React 16.14.0
System 14.3 (23D56)
Browser Chrome Version 121.0.6167.184 (Official Build) (arm64)

I posted this in SO as I thought it was not an issue but I got no response so I'm opening this here. Thank you!

@ckifer ckifer added bug General bug label enhancement Enhancement to a current API labels Feb 21, 2024
@ckifer
Copy link
Member

ckifer commented Feb 21, 2024

Looks like this is a bug as far as I can tell. When animation is not active, the sectors do not re-render on hover. When animation is active, they do. Probably a rendering optimization to be done here.

@beltranrengifo
Copy link
Author

beltranrengifo commented Feb 21, 2024

Looks like this is a bug as far as I can tell. When animation is not active, the sectors do not re-render on hover. When animation is active, they do. Probably a rendering optimization to be done here.

Thanks for your inputs @ckifer
Let me know how I can help, in case this is a bug suitable for new people in this repo 🙌

@ckifer
Copy link
Member

ckifer commented Feb 21, 2024

https://github.com/recharts/recharts/blob/3.x/src/polar/Pie.tsx#L536

This is probably where the issue is, but the fix isn't clear. I personally wouldn't recommend this as a first issue to take up, but feel free to look into it if you'd like

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

No branches or pull requests

2 participants