diff --git a/blocksuite/affine/components/src/rich-text/rich-text.ts b/blocksuite/affine/components/src/rich-text/rich-text.ts index bed5e2c136..de58c9e1f9 100644 --- a/blocksuite/affine/components/src/rich-text/rich-text.ts +++ b/blocksuite/affine/components/src/rich-text/rich-text.ts @@ -360,6 +360,12 @@ export class RichText extends WithDisposable(ShadowlessElement) { } override updated(changedProperties: Map) { + const inlineEditor = this.inlineEditor; + if (inlineEditor && this._yText && this._yText !== inlineEditor.yText) { + this._unmount(); + this._init(); + return; + } if (this._inlineEditor && changedProperties.has('readonly')) { this._inlineEditor.setReadonly(this.readonly); }