Skip to content

fix: fixed the logic for scroll event on zoom-voronoi container #3060

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dharmesh-Kota
Copy link

@Dharmesh-Kota Dharmesh-Kota commented Jul 8, 2025

Description

Summary:
This change updates the default eventHandlers in VictoryZoomContainer.defaultEvents so that the onWheel handler is only attached when props.allowZoom is true. Previously, the onWheel handler was always registered (but disabled via the handler’s disabled flag), which could still trigger unnecessary event binding and potential side effects.

Fixes:
Prevents onWheel from being registered when allowZoom is false.

Motivation and Context:

  • Avoid binding the wheel event entirely when zooming is disabled, improving performance and preventing unintended interactions in components that nest VictoryZoomContainer.
  • Simplifies the event registration logic by removing the need to check props.allowZoom inside the handler body for wheel events.

Dependencies:

  • None. This change only affects the defaultEvents configuration in victory-zoom-container.js and does not introduce new dependencies.

Fixes # (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Copy link

changeset-bot bot commented Jul 8, 2025

⚠️ No Changeset found

Latest commit: 54180c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jul 8, 2025

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

Name Status Preview Updated (UTC)
victory ✅ Ready (Inspect) Visit Preview Jul 8, 2025 1:54pm

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.

1 participant