From cfd726ea1baea1f1adeedba7b9b0119d63417233 Mon Sep 17 00:00:00 2001 From: Jesse Jorgenson Date: Wed, 7 Aug 2019 19:01:28 -0500 Subject: [PATCH] Skipping characterData mutations in Composition view descs where the value has not changed to help with redundant mutations during compositions --- src/viewdesc.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/viewdesc.js b/src/viewdesc.js index 1e7c8643..1e9a8ed2 100644 --- a/src/viewdesc.js +++ b/src/viewdesc.js @@ -481,7 +481,9 @@ class CompositionViewDesc extends ViewDesc { return {node: this.textDOM, offset: pos + (zwsp > -1 && zwsp <= pos ? 1 : 0)} } - ignoreMutation() { return false } + ignoreMutation(mut) { + return mut.type === 'characterData' && mut.target.nodeValue == mut.oldValue + } } // A mark desc represents a mark. May have multiple children,