fix: Ignore iOS mutations when unfocused (#2170)

This commit is contained in:
Jon Noronha
2021-11-18 03:37:21 -08:00
committed by GitHub
parent 6e25e99c7a
commit 10fea3b44e

View File

@@ -202,7 +202,7 @@ export class NodeView<
// this is because ProseMirror cant preventDispatch on enter // this is because ProseMirror cant preventDispatch on enter
// this will lead to a re-render of the node view on enter // this will lead to a re-render of the node view on enter
// see: https://github.com/ueberdosis/tiptap/issues/1214 // see: https://github.com/ueberdosis/tiptap/issues/1214
if (this.dom.contains(mutation.target) && mutation.type === 'childList' && isiOS()) { if (this.dom.contains(mutation.target) && mutation.type === 'childList' && isiOS() && this.editor.isFocused) {
const changedNodes = [ const changedNodes = [
...Array.from(mutation.addedNodes), ...Array.from(mutation.addedNodes),
...Array.from(mutation.removedNodes), ...Array.from(mutation.removedNodes),