mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
## Summary This PR reverts #5922 which fixed pointer capture behavior on video and image preview components to prevent unintended node dragging. ## Changes - Removes `data-capture-node="true"` attribute from `VideoPreview.vue` and `ImagePreview.vue` components - Removes pointer event delegation logic from `useNodePointerInteractions.ts` composable - Restores previous drag behavior where dragging on preview components triggers node drag ## Reason for Revert This changes the behavior from original Litegraph and is generally annoying. Users would rather be able to drag the node than be able to drag an image/video out from a node. Reverts #5922 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6148-Revert-fix-dragging-video-image-components-on-Vue-nodes-triggers-node-drag-5922-2916d73d365081398bb5c20384e26bb8) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
tabindex="0"
|
||||
role="region"
|
||||
:aria-label="$t('g.videoPreview')"
|
||||
data-capture-node="true"
|
||||
@mouseenter="handleMouseEnter"
|
||||
@mouseleave="handleMouseLeave"
|
||||
@keydown="handleKeyDown"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<div
|
||||
v-if="imageUrls.length > 0"
|
||||
class="image-preview group relative flex size-full min-h-16 min-w-16 flex-col px-2"
|
||||
data-capture-node="true"
|
||||
tabindex="0"
|
||||
role="region"
|
||||
:aria-label="$t('g.imagePreview')"
|
||||
|
||||
@@ -55,17 +55,6 @@ export function useNodePointerInteractions(
|
||||
|
||||
if (forwardMiddlePointerIfNeeded(event)) return
|
||||
|
||||
const stopNodeDragTarget =
|
||||
event.target instanceof HTMLElement
|
||||
? event.target.closest('[data-capture-node="true"]')
|
||||
: null
|
||||
if (stopNodeDragTarget) {
|
||||
if (!shouldHandleNodePointerEvents.value) {
|
||||
forwardEventToCanvas(event)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Only start drag on left-click (button 0)
|
||||
if (event.button !== 0) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user