fix: Selection jumps when dragging and selection ends outside editor bounds

This commit is contained in:
Tom Moor
2023-07-29 23:04:21 -04:00
parent 7e1ea69939
commit 20932a08d0

View File

@@ -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)))