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)
This commit is contained in:
Alexander Brown
2025-10-29 17:56:14 -07:00
committed by GitHub
parent c76f017f92
commit 86c0fb11f1

View File

@@ -12,9 +12,9 @@
: 'pointer-events-none'
)
"
@pointerdown.stop="handleWidgetPointerEvent"
@pointermove.stop="handleWidgetPointerEvent"
@pointerup.stop="handleWidgetPointerEvent"
@pointerdown="handleWidgetPointerEvent"
@pointermove="handleWidgetPointerEvent"
@pointerup="handleWidgetPointerEvent"
>
<div
v-for="(widget, index) in processedWidgets"
@@ -83,10 +83,10 @@ const { nodeData } = defineProps<NodeWidgetsProps>()
const { shouldHandleNodePointerEvents, forwardEventToCanvas } =
useCanvasInteractions()
const handleWidgetPointerEvent = (event: PointerEvent) => {
if (!shouldHandleNodePointerEvents.value) {
forwardEventToCanvas(event)
}
function handleWidgetPointerEvent(event: PointerEvent) {
if (shouldHandleNodePointerEvents.value) return
event.stopPropagation()
forwardEventToCanvas(event)
}
// Error boundary implementation