fix(core): only capture pointer if valid selection has started (#1565)

* fix(core): only capture pointer if valid selection has started

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(changeset): add

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

---------

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2024-07-31 13:14:43 +02:00
parent e62cc27f53
commit a8d837bf93
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@vue-flow/core": patch
---
Only capture pointer when a valid selection has started

View File

@@ -115,7 +115,6 @@ function onWheel(event: WheelEvent) {
function onPointerDown(event: PointerEvent) {
containerBounds.value = vueFlowRef.value?.getBoundingClientRect()
;(event.target as Element)?.setPointerCapture?.(event.pointerId)
if (
!elementsSelectable.value ||
@@ -127,6 +126,8 @@ function onPointerDown(event: PointerEvent) {
return
}
;(event.target as Element)?.setPointerCapture?.(event.pointerId)
const { x, y } = getMousePosition(event, containerBounds.value)
selectionStarted = true