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:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vue-flow/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Only capture pointer when a valid selection has started
|
||||||
@@ -115,7 +115,6 @@ function onWheel(event: WheelEvent) {
|
|||||||
|
|
||||||
function onPointerDown(event: PointerEvent) {
|
function onPointerDown(event: PointerEvent) {
|
||||||
containerBounds.value = vueFlowRef.value?.getBoundingClientRect()
|
containerBounds.value = vueFlowRef.value?.getBoundingClientRect()
|
||||||
;(event.target as Element)?.setPointerCapture?.(event.pointerId)
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!elementsSelectable.value ||
|
!elementsSelectable.value ||
|
||||||
@@ -127,6 +126,8 @@ function onPointerDown(event: PointerEvent) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;(event.target as Element)?.setPointerCapture?.(event.pointerId)
|
||||||
|
|
||||||
const { x, y } = getMousePosition(event, containerBounds.value)
|
const { x, y } = getMousePosition(event, containerBounds.value)
|
||||||
|
|
||||||
selectionStarted = true
|
selectionStarted = true
|
||||||
|
|||||||
Reference in New Issue
Block a user