Commit 34bf2a56 authored by chris's avatar chris

enter fix

parent caa7642b
......@@ -489,8 +489,14 @@ const trackedTransaction = (tr, state, editor) => {
}
if (tr.scrolledIntoView) {
newTr.scrollIntoView();
const caretPos = map.map(tr.selection.from, -1);
newTr.setSelection(new TextSelection(newTr.doc.resolve(caretPos)));
if (
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;
};
......
Markdown is supported
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