Skip to content

Commit

Permalink
fix(editor): re-init after yText change in inline editor (#9312)
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone committed Dec 26, 2024
1 parent 0220ba4 commit 37e44e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions blocksuite/affine/components/src/rich-text/rich-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,12 @@ export class RichText extends WithDisposable(ShadowlessElement) {
}

override updated(changedProperties: Map<string | number | symbol, unknown>) {
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);
}
Expand Down

0 comments on commit 37e44e0

Please sign in to comment.