Skip to content

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)

@changeset-bot
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

@vercel
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