Hi,
How to reset editor state or “clear document”? I tried to reset it through setting view to default document with window.editor.view.updateState({doc, ...window.editor.state.config})
but that leads to
Uncaught TypeError: Cannot read property '$head' of undefined
at needsCursorWrapper (index.js:2250)
at updateCursorWrapper (index.js:4487)
at EditorView.updateState (index.js:4225)
at <anonymous>:1:20
function needsCursorWrapper(state) {
var ref = state.selection;
var $head = ref.$head; // <-- here