From 012771fccc786dc9e6fcdeed624b3a334ac57f7d Mon Sep 17 00:00:00 2001 From: yanmao <55792257+yanmao-cc@users.noreply.github.com> Date: Thu, 30 Dec 2021 00:36:51 +0800 Subject: [PATCH] fix(mark-range): The internal nodes of the card will cause the id to be lost --- packages/engine/src/scrollbar/index.ts | 2 +- plugins/mark-range/src/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/engine/src/scrollbar/index.ts b/packages/engine/src/scrollbar/index.ts index 672f65ad..8d9047d3 100644 --- a/packages/engine/src/scrollbar/index.ts +++ b/packages/engine/src/scrollbar/index.ts @@ -246,7 +246,7 @@ class Scrollbar extends EventEmitter2 { this.reRenderY(scrollTop); } }, - 50, + 0, { leading: true }, ); diff --git a/plugins/mark-range/src/index.ts b/plugins/mark-range/src/index.ts index 0c871a2c..55eefd7e 100644 --- a/plugins/mark-range/src/index.ts +++ b/plugins/mark-range/src/index.ts @@ -405,6 +405,10 @@ export default class extends MarkPlugin { if (cardComponent && cardComponent.onChange) cardComponent.onChange('local', cardComponent.root); } + const cardComponent = this.editor.card.find(mark); + if (cardComponent && cardComponent.executeMark) { + cardComponent.executeMark(mark.clone(), false); + } }); this.#isApply = true; }