mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-19 00:10:39 +08:00
fix(editor): re-init after yText change in inline editor (#9312)
Closes: [BS-2143](https://linear.app/affine-design/issue/BS-2143/block通过drag-handle拖动位置后,无法输入)
This commit is contained in:
@@ -360,6 +360,12 @@ export class RichText extends WithDisposable(ShadowlessElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override updated(changedProperties: Map<string | number | symbol, unknown>) {
|
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')) {
|
if (this._inlineEditor && changedProperties.has('readonly')) {
|
||||||
this._inlineEditor.setReadonly(this.readonly);
|
this._inlineEditor.setReadonly(this.readonly);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user