Skip to content

Conversation

kaspermunch
Copy link

Summary

This PR fixes an issue where scrolling the mouse wheel to zoom in the HiGlass widget would also scroll the Jupyter notebook page, particularly noticeable when running notebooks in VS Code.

Changes

  • Added a wheel event listener to the widget container that calls stopPropagation() to prevent the event from bubbling up to the notebook page
  • Set passive: false to ensure the event handler can properly intercept wheel events

Testing

  • Tested in VS Code with Jupyter notebooks
  • Verified that mouse wheel zoom works correctly in the HiGlass widget
  • Confirmed that the notebook page no longer scrolls when zooming the widget

Technical Details

The fix is implemented in src/higlass/widget.js in the addEventListenersTo() function, following the same pattern as the existing contextmenu event handler. This approach ensures wheel events are handled at the widget level before they can trigger page scrolling.

🤖 Generated with Claude Code

Adds a wheel event listener that prevents event propagation to the parent
page while still allowing HiGlass to handle zoom interactions. This fixes
the issue where scrolling to zoom in the HiGlass widget would also scroll
the Jupyter notebook page, particularly when running notebooks in VS Code.

The fix uses stopPropagation() with passive: false to intercept wheel
events at the widget container level before they bubble up to the notebook.
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