Skip to content

Commit

Permalink
Merge pull request slab#3223 from luin/ignore-nested-quill-mutations
Browse files Browse the repository at this point in the history
Ignore mutations happens in nested Quill instance
  • Loading branch information
jhchen authored Nov 12, 2020
2 parents e9f628b + 8f6257c commit 8ce3ee3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blots/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8ce3ee3

Please sign in to comment.