diff --git a/packages/react/src/container/Pane/index.tsx b/packages/react/src/container/Pane/index.tsx index 3dcf55bd..ef86be3f 100644 --- a/packages/react/src/container/Pane/index.tsx +++ b/packages/react/src/container/Pane/index.tsx @@ -116,7 +116,8 @@ export function Pane({ const onWheel = onPaneScroll ? (event: React.WheelEvent) => onPaneScroll(event) : undefined; const onClickCapture = (event: ReactMouseEvent) => { - const isSelectionOnDragActive = (selectionOnDrag && container.current === event.target) || !selectionOnDrag; + const isSelectionOnDragActive = + (selectionOnDrag && container.current === event.target) || !selectionOnDrag || selectionKeyPressed; if (!isSelectionOnDragActive) { return; diff --git a/packages/svelte/src/lib/container/Pane/Pane.svelte b/packages/svelte/src/lib/container/Pane/Pane.svelte index 7b76a65e..ef77b1de 100644 --- a/packages/svelte/src/lib/container/Pane/Pane.svelte +++ b/packages/svelte/src/lib/container/Pane/Pane.svelte @@ -230,7 +230,18 @@ onpanecontextmenu?.({ event }); }; - const onClickCapture = (event: MouseEvent) => event.stopPropagation(); + const onClickCapture = (event: MouseEvent) => { + const isSelectionActive = + (selectionOnDrag && container === event.target) || + !selectionOnDrag || + store.selectionKeyPressed; + + if (!isSelectionActive) { + return; + } + + event.stopPropagation(); + };