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: fix BackSpace cannot fallback and delete after triggering formula through fx (#5477)

wpxp12345626953b1bbcf9
diff --git a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
index f487745154..bacc001707 100644
--- a/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
+++ b/packages/sheets-ui/src/views/formula-bar/FormulaBar.tsx
@@ -18,6 +18,7 @@ import type { Workbook } from '@univerjs/core';
import type { IEditorBridgeServiceVisibleParam } from '../../services/editor-bridge.service';
import {
DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,
+ EDITOR_ACTIVATED,
FOCUSING_FX_BAR_EDITOR,
ICommandService,
IContextService,
@@ -86,7 +87,7 @@ export function FormulaBar(props: IProps) {
const formulaAuxUIParts = useComponentsOfPart(SheetsUIPart.FORMULA_AUX);
const contextService = useDependency(IContextService);
useObservable(useMemo(() => contextService.subscribeContextValue$(FOCUSING_FX_BAR_EDITOR), [contextService]));
- const isFocusFxBar = contextService.getContextValue(FOCUSING_FX_BAR_EDITOR);
+ const isFocusFxBar = contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) || contextService.getContextValue(EDITOR_ACTIVATED);
const ref = useRef<HTMLDivElement>(null);
const editorService = useDependency(IEditorService);