File tree 2 files changed +11
-3
lines changed
packages/core/src/container/Pane
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @vue-flow/core " : patch
3
+ ---
4
+
5
+ Handle pointer capture for selection on drag
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ function onWheel(event: WheelEvent) {
114
114
115
115
function onPointerDown(event : PointerEvent ) {
116
116
containerBounds .value = vueFlowRef .value ?.getBoundingClientRect ()
117
- container . value ?.setPointerCapture (event .pointerId )
117
+ ;( event . target as Element ) ?.setPointerCapture ?. (event .pointerId )
118
118
119
119
if (
120
120
! elementsSelectable .value ||
@@ -147,6 +147,7 @@ function onPointerDown(event: PointerEvent) {
147
147
}
148
148
149
149
userSelectionActive .value = true
150
+ nodesSelectionActive .value = false
150
151
151
152
emits .selectionStart (event )
152
153
}
@@ -215,15 +216,17 @@ function onPointerUp(event: PointerEvent) {
215
216
return
216
217
}
217
218
218
- container . value ?.releasePointerCapture (event .pointerId )
219
+ ;( event . target as Element ) ?.releasePointerCapture (event .pointerId )
219
220
220
221
// We only want to trigger click functions when in selection mode if
221
222
// the user did not move the mouse.
222
223
if (! userSelectionActive .value && userSelectionRect .value && event .target === container .value ) {
223
224
onClick (event )
224
225
}
225
226
226
- nodesSelectionActive .value = prevSelectedNodesCount .value > 0
227
+ if (prevSelectedNodesCount .value > 0 ) {
228
+ nodesSelectionActive .value = true
229
+ }
227
230
228
231
resetUserSelection ()
229
232
You can’t perform that action at this time.
0 commit comments