From 8f6257ceb5d073070d9a626fcd8e564fc1f6aa6a Mon Sep 17 00:00:00 2001 From: luin Date: Wed, 11 Nov 2020 14:57:32 +0800 Subject: [PATCH] Ignore mutations happens in nested Quill instance --- blots/scroll.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blots/scroll.js b/blots/scroll.js index dfaa8b278b..4d6ff5cb43 100644 --- a/blots/scroll.js +++ b/blots/scroll.js @@ -164,6 +164,10 @@ class Scroll extends ScrollBlot { if (!Array.isArray(mutations)) { mutations = this.observer.takeRecords(); } + mutations = mutations.filter(({ target }) => { + const blot = this.find(target, true); + return blot && blot.scroll === this; + }); if (mutations.length > 0) { this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations); }