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

fix: create separate handler instances for containers #2890

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

r281GQ
Copy link

@r281GQ r281GQ commented Aug 30, 2024

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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)

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run all builds, tests, and linting and all checks pass
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Aug 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
victory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 8:26pm

Copy link

changeset-bot bot commented Aug 30, 2024

🦋 Changeset detected

Latest commit: 0243c3d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
victory-native Patch
victory-voronoi-container Patch
victory-create-container Patch
victory Patch
victory-area Patch
victory-axis Patch
victory-bar Patch
victory-box-plot Patch
victory-brush-container Patch
victory-brush-line Patch
victory-candlestick Patch
victory-canvas Patch
victory-chart Patch
victory-core Patch
victory-cursor-container Patch
victory-errorbar Patch
victory-group Patch
victory-histogram Patch
victory-legend Patch
victory-line Patch
victory-pie Patch
victory-polar-axis Patch
victory-scatter Patch
victory-selection-container Patch
victory-shared-events Patch
victory-stack Patch
victory-tooltip Patch
victory-vendor Patch
victory-voronoi Patch
victory-zoom-container Patch
victory-docs Patch

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

@r281GQ r281GQ changed the title [WIP] - fix: create separate instances for container instances fix: create separate handler instances for containers Sep 12, 2024
@@ -46,13 +46,15 @@ VictoryVoronoiContainer.defaultEvents = (
? {}
: handler(event, { ...props, ...targetProps }, eventKey, context);

const voronioHelper = new VoronoiHelpers();

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.

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

Successfully merging this pull request may close these issues.

VictoryVoronoiContainer tooltip breaks when mouse moves between different chats
2 participants