Skip to content

Commit ba2a334

Browse files
committed
Cleaner link drop handling
1 parent c5629f6 commit ba2a334

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
:class="cn('-translate-x-1/2 w-3', errorClassesDot)"
99
@click="onClick"
1010
@dblclick="onDoubleClick"
11-
@pointerdown.stop.prevent="pointerDown"
12-
@pointerup.stop.prevent="pointerUp"
13-
@pointerleave.stop.prevent="(e: PointerEvent) => pointerLeave(e)"
11+
@pointerdown="onPointerDown"
1412
/>
1513

1614
<!-- Slot Name -->
@@ -151,15 +149,4 @@ const { onClick, onDoubleClick, onPointerDown } = useSlotLinkInteraction({
151149
index: props.index,
152150
type: 'input'
153151
})
154-
155-
let pointerLeave: (leavEvent: PointerEvent) => void = () => {}
156-
function pointerDown(e: PointerEvent) {
157-
pointerLeave = () => {
158-
onPointerDown(e)
159-
pointerLeave = () => {}
160-
}
161-
}
162-
function pointerUp() {
163-
pointerLeave = () => {}
164-
}
165152
</script>

src/renderer/extensions/vueNodes/composables/useSlotLinkInteraction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ export function useSlotLinkInteraction({
504504

505505
const hasConnected = connectByPriority(canvasEvent.target, snappedCandidate)
506506

507-
if (!hasConnected) {
507+
if (!hasConnected && event.target === app.canvas?.canvas) {
508508
activeAdapter?.dropOnCanvas(canvasEvent)
509509
}
510510

0 commit comments

Comments
 (0)