fix selectOnDrag for Svelte Flow

This commit is contained in:
peterkogo
2025-10-16 12:09:06 +02:00
parent cefd92664d
commit 353a497e71
2 changed files with 7 additions and 1 deletions

View File

@@ -97,12 +97,18 @@
const isNoKeyEvent =
event.target !== container && !!(event.target as HTMLElement).closest('.nokey');
const isSelectionActive =
(selectionOnDrag && container === event.target) ||
!selectionOnDrag ||
store.selectionKeyPressed;
if (
!store.elementsSelectable ||
!isSelecting ||
event.button !== 0 ||
!containerBounds ||
isNoKeyEvent ||
!isSelectionActive ||
!event.isPrimary
) {
return;