Skip to content

Conversation

jtydhr88
Copy link
Collaborator

@jtydhr88 jtydhr88 commented Sep 27, 2025

Summary

Add generic wheel event capture mechanism for interactive widgets in vueNodes system to prevent event bubbling to canvas.

Changes

  • What: Add event handling logic in LGraphNode.vue and GraphCanvas.vue that checks for data-capture-wheel attribute to determine whether wheel events should be forwarded to the canvas
  • How it works: Components that need to capture wheel events (like Three.js scenes) can add data-capture-wheel="true" attribute to prevent wheel events from bubbling up to the canvas zoom handler

prerequirist for #5765

┆Issue is synchronized with this Notion page by Unito

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 27, 2025
Copy link

github-actions bot commented Sep 27, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 09/30/2025, 01:33:21 AM UTC

📈 Summary

  • Total Tests: 478
  • Passed: 446 ✅
  • Failed: 0
  • Flaky: 3 ⚠️
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 438 / ❌ 0 / ⚠️ 3 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 5 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @arjansingh and @christian-byrne who have also been trying to handle Litegraph's aggressive event capturing.

const handleTransformPaneWheel = (event: WheelEvent) => {
// Check if the wheel event is from an element that wants to capture wheel events
const target = event.target as HTMLElement
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer an instanceof check for the target, if possible.

const handleTransformPaneWheel = (event: WheelEvent) => {
// Check if the wheel event is from an element that wants to capture wheel events
const target = event.target as HTMLElement
const captureElement = target?.closest('[data-capture-wheel="true"]')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have this set on anything currently?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, but I will use it in 3d node later if we merge this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you flip the order so that this is functional at the point that it merges?

@arjansingh
Copy link
Contributor

CC @arjansingh and @christian-byrne who have also been trying to handle Litegraph's aggressive event capturing.

#5793

we're not merging this but this is how proposed dealing with wheel events

@jtydhr88
Copy link
Collaborator Author

CC @arjansingh and @christian-byrne who have also been trying to handle Litegraph's aggressive event capturing.

#5793

we're not merging this but this is how proposed dealing with wheel events

Ok, thanks for the information, I can check this can fix my issue in 3d node

@comfyui-wiki
Copy link
Member

Screen.Recording.2025-09-30.at.10.07.14.mov

After testing, I think this PR can solve #5691.

@christian-byrne christian-byrne merged commit 28a779d into main Sep 30, 2025
22 checks passed
@christian-byrne christian-byrne deleted the capture-wheel branch September 30, 2025 02:51
christian-byrne pushed a commit that referenced this pull request Oct 6, 2025
…el events (#5821)

## Summary

Add generic wheel event capture mechanism for interactive widgets in
vueNodes system to prevent event bubbling to canvas.

  ## Changes

- What: Add event handling logic in LGraphNode.vue and GraphCanvas.vue
that checks for data-capture-wheel attribute to determine whether wheel
events should be forwarded to the canvas
- How it works: Components that need to capture wheel events (like
Three.js scenes) can add data-capture-wheel="true" attribute to prevent
wheel events from bubbling up to the canvas zoom handler

prerequirist for #5765

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5821-Check-if-the-wheel-event-is-from-an-element-that-wants-to-capture-wheel-events-27b6d73d3650812493b5f13849147e6c)
by [Unito](https://www.unito.io)
arjansingh pushed a commit that referenced this pull request Oct 7, 2025
…el events (#5821)

## Summary

Add generic wheel event capture mechanism for interactive widgets in
vueNodes system to prevent event bubbling to canvas.

  ## Changes

- What: Add event handling logic in LGraphNode.vue and GraphCanvas.vue
that checks for data-capture-wheel attribute to determine whether wheel
events should be forwarded to the canvas
- How it works: Components that need to capture wheel events (like
Three.js scenes) can add data-capture-wheel="true" attribute to prevent
wheel events from bubbling up to the canvas zoom handler

prerequirist for #5765

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5821-Check-if-the-wheel-event-is-from-an-element-that-wants-to-capture-wheel-events-27b6d73d3650812493b5f13849147e6c)
by [Unito](https://www.unito.io)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Try to scroll the Vue node widget options, but it seems to conflict with the canvas zoom in/out.

5 participants