Skip to content
Snippets Groups Projects
Commit 34bf2a56 authored by chris's avatar chris
Browse files

enter fix

parent caa7642b
No related branches found
No related tags found
1 merge request!21Track changes
...@@ -489,8 +489,14 @@ const trackedTransaction = (tr, state, editor) => { ...@@ -489,8 +489,14 @@ const trackedTransaction = (tr, state, editor) => {
} }
if (tr.scrolledIntoView) { if (tr.scrolledIntoView) {
newTr.scrollIntoView(); newTr.scrollIntoView();
const caretPos = map.map(tr.selection.from, -1); if (
newTr.setSelection(new TextSelection(newTr.doc.resolve(caretPos))); tr.selection instanceof TextSelection &&
(tr.selection.from < state.selection.from ||
tr.getMeta("inputType") === "deleteContentBackward")
) {
const caretPos = map.map(tr.selection.from, -1);
newTr.setSelection(new TextSelection(newTr.doc.resolve(caretPos)));
}
} }
return newTr; return newTr;
}; };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment