Skip to content

Commit 86c0fb1

Browse files
authored
Fix: Only stop propagation of events forwarded to the canvas. (#6387)
## Summary Allows users to drag nodes while clicking things like the widget labels. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6387-Fix-Only-stop-propagation-of-events-forwarded-to-the-canvas-29c6d73d365081bdb952c5e7f409031e) by [Unito](https://www.unito.io)
1 parent c76f017 commit 86c0fb1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/renderer/extensions/vueNodes/components/NodeWidgets.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
: 'pointer-events-none'
1313
)
1414
"
15-
@pointerdown.stop="handleWidgetPointerEvent"
16-
@pointermove.stop="handleWidgetPointerEvent"
17-
@pointerup.stop="handleWidgetPointerEvent"
15+
@pointerdown="handleWidgetPointerEvent"
16+
@pointermove="handleWidgetPointerEvent"
17+
@pointerup="handleWidgetPointerEvent"
1818
>
1919
<div
2020
v-for="(widget, index) in processedWidgets"
@@ -83,10 +83,10 @@ const { nodeData } = defineProps<NodeWidgetsProps>()
8383
8484
const { shouldHandleNodePointerEvents, forwardEventToCanvas } =
8585
useCanvasInteractions()
86-
const handleWidgetPointerEvent = (event: PointerEvent) => {
87-
if (!shouldHandleNodePointerEvents.value) {
88-
forwardEventToCanvas(event)
89-
}
86+
function handleWidgetPointerEvent(event: PointerEvent) {
87+
if (shouldHandleNodePointerEvents.value) return
88+
event.stopPropagation()
89+
forwardEventToCanvas(event)
9090
}
9191
9292
// Error boundary implementation

0 commit comments

Comments
 (0)