Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(core): fix editor set focus element by mistake

Wenzhao Hu9b0ba2146b09
diff --git a/packages/ui/src/services/editor/editor.service.ts b/packages/ui/src/services/editor/editor.service.ts
index af60f74ca9..9c07b1748a 100644
--- a/packages/ui/src/services/editor/editor.service.ts
+++ b/packages/ui/src/services/editor/editor.service.ts
@@ -654,6 +654,9 @@ export class EditorService extends Disposable implements IEditorService, IDispos
this._univerInstanceService.disposeUnit(editorUnitId);
this._contextService.setContextValue(FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, false);
+ // DEBT: no necessary when we refactor editor module
+ if (!this.isSheetEditor(editorUnitId)) return;
+
/**
* Compatible with the editor in the sheet scenario,
* it is necessary to refocus back to the current sheet when unloading.