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({
8585
8686 // when vue-flow is used inside a shadow root we can't use document
8787 const doc = getHostForElement ( event . target as HTMLElement )
88+ const clickedHandle = event . currentTarget as HTMLElement | null
8889
89- if ( ( isMouseTriggered && event . button === 0 ) || ! isMouseTriggered ) {
90+ if ( clickedHandle && ( ( isMouseTriggered && event . button === 0 ) || ! isMouseTriggered ) ) {
9091 const node = findNode ( toValue ( nodeId ) )
9192
9293 let isValidConnectionHandler = toValue ( isValidConnection ) || isValidConnectionProp . value || alwaysValid
@@ -100,7 +101,6 @@ export function useHandle({
100101 let autoPanId = 0
101102
102103 const { x, y } = getEventPosition ( event )
103- const clickedHandle = doc ?. elementFromPoint ( x , y )
104104 const handleType = getHandleType ( toValue ( edgeUpdaterType ) , clickedHandle )
105105 const containerBounds = vueFlowRef . value ?. getBoundingClientRect ( )
106106
You can’t perform that action at this time.
0 commit comments