fix(core): inlineEditor on rich-text may be null (#8131)
See https://github.com/toeverything/blocksuite/blob/3d3d9d7862ac91091688b3c491571f6333b97df7/packages/affine/components/src/rich-text/rich-text.ts#L348-L350 https://github.com/toeverything/blocksuite/blob/master/packages/affine/components/src/rich-text/rich-text.ts#L36
This commit is contained in:
1 file changed
+2
-2
@@ -177,9 +177,9 @@ export class Editor extends Entity {
|
|||||||
});
|
});
|
||||||
if (focusAt$.value === null && docTitle) {
|
if (focusAt$.value === null && docTitle) {
|
||||||
const title = docTitle.querySelector<
|
const title = docTitle.querySelector<
|
||||||
HTMLElement & { inlineEditor: InlineEditor }
|
HTMLElement & { inlineEditor: InlineEditor | null }
|
||||||
>('rich-text');
|
>('rich-text');
|
||||||
title?.inlineEditor.focusEnd();
|
title?.inlineEditor?.focusEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
const subscription = focusAt$
|
const subscription = focusAt$
|
||||||
|
|||||||
Reference in new issue
Block a user