From 8bc1c9925272c4ed2b5a8679a4e1c35a348f24c0 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 5 Jun 2024 20:19:41 +0200 Subject: [PATCH] fix(core): disable drag when using multi-touch (#1448) * fix(core): disable drag when using multi-touch * chore(changeset): add --- .changeset/selfish-vans-report.md | 5 +++++ packages/core/src/composables/useDrag.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/selfish-vans-report.md diff --git a/.changeset/selfish-vans-report.md b/.changeset/selfish-vans-report.md new file mode 100644 index 00000000..0baa379e --- /dev/null +++ b/.changeset/selfish-vans-report.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Disable dragging when using multi-touch diff --git a/packages/core/src/composables/useDrag.ts b/packages/core/src/composables/useDrag.ts index 7a6c6947..1ba7a975 100644 --- a/packages/core/src/composables/useDrag.ts +++ b/packages/core/src/composables/useDrag.ts @@ -185,6 +185,10 @@ export function useDrag(params: UseDragParams) { } const eventStart = (event: UseDragEvent, nodeEl: Element) => { + if (event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) { + return + } + if (nodeDragThreshold.value === 0) { startDrag(event, nodeEl) }