File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/core/src/composables Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @vue-flow/core " : minor
3
+ ---
4
+
5
+ Use event target for ` <Handle> ` components to determine the "clicked" handle, avoiding calls to `getElementFromPoint and allowing "detached" handles
Original file line number Diff line number Diff line change @@ -85,8 +85,9 @@ export function useHandle({
85
85
86
86
// when vue-flow is used inside a shadow root we can't use document
87
87
const doc = getHostForElement ( event . target as HTMLElement )
88
+ const clickedHandle = event . currentTarget as HTMLElement | null
88
89
89
- if ( ( isMouseTriggered && event . button === 0 ) || ! isMouseTriggered ) {
90
+ if ( clickedHandle && ( ( isMouseTriggered && event . button === 0 ) || ! isMouseTriggered ) ) {
90
91
const node = findNode ( toValue ( nodeId ) )
91
92
92
93
let isValidConnectionHandler = toValue ( isValidConnection ) || isValidConnectionProp . value || alwaysValid
@@ -100,7 +101,6 @@ export function useHandle({
100
101
let autoPanId = 0
101
102
102
103
const { x, y } = getEventPosition ( event )
103
- const clickedHandle = doc ?. elementFromPoint ( x , y )
104
104
const handleType = getHandleType ( toValue ( edgeUpdaterType ) , clickedHandle )
105
105
const containerBounds = vueFlowRef . value ?. getBoundingClientRect ( )
106
106
You can’t perform that action at this time.
0 commit comments