Also call onCursor when document loaded.

This commit is contained in:
Ulion 2021-01-29 08:02:16 +08:00
parent 9ff2ecf29a
commit 3d0cf7597a

View File

@ -99,7 +99,9 @@ export const AutomergeEditor = {
e.docSet.setDoc(docId, mergedDoc) e.docSet.setDoc(docId, mergedDoc)
Editor.withoutNormalizing(e, () => { Editor.withoutNormalizing(e, () => {
e.children = toJS(mergedDoc).children const doc = toJS(mergedDoc)
e.children = doc.children
e.onCursor && e.onCursor(doc.cursors)
}) })
// onChange expect valid doc, we make sure do normalization before that. // onChange expect valid doc, we make sure do normalization before that.