-
Notifications
You must be signed in to change notification settings - Fork 525
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
fix: create separate handler instances for containers #2890
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 0243c3d The changes in this PR will be included in the next version bump. This PR includes changesets to release 31 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -46,13 +46,15 @@ VictoryVoronoiContainer.defaultEvents = ( | |||
? {} | |||
: handler(event, { ...props, ...targetProps }, eventKey, context); | |||
|
|||
const voronioHelper = new VoronoiHelpers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having a similar issue and need this fix too and came across this PR. Thanks for working on this!
One thing I noticed: doesn't this change break throttling though? We're now creating a new instance of the throttling function each time defaultEvents
is called when VoronoiHelpers
is instantiated.
Description
Fixes #2369
When two VoronaiContainers are used the tooltips does not show up / disappear consistently.
See video below:
bug.mp4
Expected behaviour is consistent:
expected.mp4
This PR makes separate instances for every container so no references would be captured in another container.
Type of Change
How Has This Been Tested?
Test was done manually. The same way as is shown in the videos. Tooltips show up consistently.
Checklist: (Feel free to delete this section upon completion)