prosemirror-view version : v1.13.7
the question is a little bit like https://github.com/ProseMirror/prosemirror/issues/909, but in v1.13.7, pm use mutationObserver instead.
sometimes i click on a block to make it active ( .prosemirror-selectnode class added) , then click on textContent, the cursor seems change to textContent, but block’s active class not removed, besides, if type something in that case, the block will be removed ( probably cursor is still remembered at that block node)
after check source code, i find the problem seem comes from code blow: // in prosemirror-view domObserver.js
DOMObserver {
this.observer = window.MutationObserver (() => {
if xx flushSoon()
else flush()
})
connectSelection () {
this.view.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange)
}
}
if add test code in my project like blow, in my testPlugin
apply(tr) {
console.log('update')
},
when the problem occurs, browser not emit selectionchange event at all and mutationObserver callback not fires,and no ‘update’ console as well. if work as expected sometimes, the two callbacks will fires and will console “update”