Skip to content
Snippets Groups Projects
Commit 984849e7 authored by chris's avatar chris
Browse files

allow cursor to move from block to block

parent e71da4e3
No related branches found
No related tags found
1 merge request!107Tracked transaction
......@@ -47,7 +47,7 @@ const Editoria = () => (
autoFocus
placeholder="Type Something..."
fileUpload={file => renderImage(file)}
value={"this is some content"}
value={"<p>this is some content</p><p>second paragraph</p>"}
layout={EditoriaLayout}
TrackChange
// onChange={source => console.log(source)}
......
......@@ -298,6 +298,13 @@ const trackedTransaction = (tr, state, user) => {
if (tr.scrolledIntoView) {
newTr.scrollIntoView();
}
if (
tr.selection instanceof TextSelection &&
tr.selection.from < state.selection.from
) {
const caretPos = map.map(tr.selection.from, -1);
newTr.setSelection(new TextSelection(newTr.doc.resolve(caretPos)));
}
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