diff --git a/packages/sheets-ui/src/controllers/editor-bridge.controller.ts b/packages/sheets-ui/src/controllers/editor-bridge.controller.ts index 6b260b574e7..fb762d7a8d2 100644 --- a/packages/sheets-ui/src/controllers/editor-bridge.controller.ts +++ b/packages/sheets-ui/src/controllers/editor-bridge.controller.ts @@ -85,6 +85,7 @@ export class EditorBridgeController extends RxDisposable { } const textSelectionRenderManager = this._injector.get(ITextSelectionRenderManager, Quantity.OPTIONAL); + if (!this._layoutService.checkCanvasIsFocused() && textSelectionRenderManager && !textSelectionRenderManager!.hasFocus()) { return; } diff --git a/packages/ui/src/services/layout/layout.service.ts b/packages/ui/src/services/layout/layout.service.ts index b82a71e00f6..3f2a0a17466 100644 --- a/packages/ui/src/services/layout/layout.service.ts +++ b/packages/ui/src/services/layout/layout.service.ts @@ -23,7 +23,7 @@ import { IEditorService } from '../editor/editor.service'; type FocusHandlerFn = (unitId: string) => void; export const FOCUSING_UNIVER = 'FOCUSING_UNIVER'; -const collectionOfCnForFocusableEle = ['univer-app-layout', 'univer-toolbar-btn', 'univer-menu-item', 'univer-button']; +const collectionOfCnForFocusableEle = ['univer-app-layout', 'univer-toolbar-btn', 'univer-menu-item', 'univer-button', 'univer-sheet-bar-btn']; export interface ILayoutService { readonly isFocused: boolean;