From 20932a08d055678cd76096cf3f0b4ae5f825326d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 29 Jul 2023 23:04:21 -0400 Subject: [PATCH] fix: Selection jumps when dragging and selection ends outside editor bounds --- app/editor/components/SelectionToolbar.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/editor/components/SelectionToolbar.tsx b/app/editor/components/SelectionToolbar.tsx index 5129cb6a4..2ade810d0 100644 --- a/app/editor/components/SelectionToolbar.tsx +++ b/app/editor/components/SelectionToolbar.tsx @@ -131,6 +131,10 @@ export default function SelectionToolbar(props: Props) { return; } + if (!window.getSelection()?.isCollapsed) { + return; + } + const { dispatch } = view; dispatch( view.state.tr.setSelection(new TextSelection(view.state.doc.resolve(0)))