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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,7 +202,7 @@ export class NodeView<
// this is because ProseMirror cant preventDispatch on enter
// this will lead to a re-render of the node view on enter
// 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 = [
...Array.from(mutation.addedNodes),
...Array.from(mutation.removedNodes),