-
Notifications
You must be signed in to change notification settings - Fork 492
fix: stop pointer/mouse event propagation in vueNodes widget containers #7953
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 647
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 726
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 5752
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 52
🏁 Script executed:
cat -n src/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue | head -60Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2738
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1308
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2068
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 592
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 930
🏁 Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 4131
Remove event propagation stopping from
pointerupandpointermoveto allow tooltip state cleanup on the document.The
pointerupevent is stopped, which preventsdocument.addEventListener('pointerup', handlePointerUp)inuseNodeTooltips.tsfrom firing. This leaves tooltips permanently disabled. Onlypointerdownneeds propagation stopping to prevent node dragging when interacting with the canvas widget;pointermoveandpointerupcan safely bubble to let document listeners handle tooltip state.Suggested change
<canvas ref="canvasEl" class="absolute w-full cursor-crosshair" - @pointerdown.stop="handleDown" - @pointerup.stop="handleUp" - @pointermove.stop="handleMove" + @pointerdown.capture.stop="handleDown" + @pointerup="handleUp" + @pointermove="handleMove" />📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to clean up all these different listeners...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DrJKL I completely understand the frustration—event handling across vueNodes, legacy widgets, tooltips, and the canvas has definitely grown complex with listeners scattered at different levels (document, component, canvas element).
If you'd like, I can help in a few ways:
Just let me know if any of that would be helpful! Otherwise, I recognize this is more of a "note for later" observation. 🐰
🧠 Learnings used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai, yes please. Be our leporine cartographer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@DrJKL Excellent! 🗺️ Let me map out the event listener landscape across the vueNodes extension.
🏁 Script executed:
Length of output: 9552
🏁 Script executed:
Length of output: 5766
Perfect! Here's your event listener map 🗺️
📍 Event Listener Landscape - vueNodes Extension
1️⃣ Document/Window Level (Global State Management)
2️⃣ Widget Event Handling (Preventing Node Drag)
3️⃣ Node-Level Interaction
4️⃣ Slot Link Creation (Connection Drawing)
5️⃣ Node Resize
6️⃣ Other UI Elements
🎯 Consolidation Opportunities
High Priority
useEventListenerfor proper cleanupMedium Priority
useElementHover(per existing learning)Low Priority
useWidgetInteractioncomposable.capture.stopvs.stopNow let me create a tracking issue for this refactoring work:
🏁 Script executed:
Length of output: 41
🏁 Script executed:
Length of output: 57
Perfect! 🐰 The cartographic expedition is complete!
Summary
I've mapped 6 distinct event listener patterns across the vueNodes extension:
addEventListener.stoppatternsKey Findings
.stopstrategies across similar widget components📋 Tracking Issue Created
#7956: Refactor: Consolidate vueNodes event listener patterns
The issue includes:
You can add labels and adjust priorities as needed! 🗺️✨
🧠 Learnings used