Skip to content

Commit

Permalink
fix(sheet): editor set rich error (#1918)
Browse files Browse the repository at this point in the history
  • Loading branch information
DR-Univer authored Apr 15, 2024
1 parent 5b6e223 commit d4f67f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/ui/src/services/layout/layout.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class DesktopLayoutService extends Disposable implements ILayoutService {
fromEvent(window, 'focusin').subscribe((event) => {
const target = event.target as HTMLElement;
if (collectionOfCnForFocusableEle.some((item) => target.classList.contains(item))) {
this._editorService.blur();
this._editorBlurListener();
queueMicrotask(() => this.focus());
return;
}
Expand All @@ -172,6 +172,13 @@ export class DesktopLayoutService extends Disposable implements ILayoutService {
getFocusingUniverEditorStatus()
);
}

private _editorBlurListener() {
const focusEditor = this._editorService.getFocusEditor();
if (focusEditor && focusEditor.isSheetEditor() !== true) {
this._editorService.blur();
}
}
}

function getFocusingUniverEditorStatus(): boolean {
Expand Down

0 comments on commit d4f67f8

Please sign in to comment.