From 203f7cbc0136cfaf995cd82d6fe512040c0f02e2 Mon Sep 17 00:00:00 2001 From: wpxp123456 <2677556700@qq.com> Date: Mon, 29 Dec 2025 18:13:47 +0800 Subject: [PATCH] fix(shortcut): fix delete drawing shortcut (#6401) --- .../src/controllers/shortcuts/drawing.shortcut.ts | 3 ++- .../src/controllers/shortcuts/drawing.shortcut.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts b/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts index 2702685761..dafae39b90 100644 --- a/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts +++ b/packages/docs-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts @@ -17,13 +17,14 @@ import type { IContextService } from '@univerjs/core'; import type { IShortcutItem } from '@univerjs/ui'; import type { IMoveDrawingsCommandParams } from '../../commands/commands/move-drawings.command'; -import { Direction, FOCUSING_COMMON_DRAWINGS, FOCUSING_UNIVER_EDITOR } from '@univerjs/core'; +import { Direction, FOCUSING_COMMON_DRAWINGS, FOCUSING_DOC, FOCUSING_UNIVER_EDITOR } from '@univerjs/core'; import { KeyCode } from '@univerjs/ui'; import { DeleteDocDrawingsCommand } from '../../commands/commands/delete-doc-drawing.command'; import { MoveDocDrawingsCommand } from '../../commands/commands/move-drawings.command'; export function whenDocDrawingFocused(contextService: IContextService): boolean { return ( + contextService.getContextValue(FOCUSING_DOC) && contextService.getContextValue(FOCUSING_UNIVER_EDITOR) && contextService.getContextValue(FOCUSING_COMMON_DRAWINGS) ); diff --git a/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts b/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts index 1c7439de2b..ef16e02e07 100644 --- a/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts +++ b/packages/sheets-drawing-ui/src/controllers/shortcuts/drawing.shortcut.ts @@ -17,13 +17,14 @@ import type { IContextService } from '@univerjs/core'; import type { IShortcutItem } from '@univerjs/ui'; import type { IMoveDrawingsCommandParams } from '../../commands/commands/move-drawings.command'; -import { Direction, EDITOR_ACTIVATED, FOCUSING_COMMON_DRAWINGS, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR } from '@univerjs/core'; +import { Direction, EDITOR_ACTIVATED, FOCUSING_COMMON_DRAWINGS, FOCUSING_FX_BAR_EDITOR, FOCUSING_PANEL_EDITOR, FOCUSING_SHEET } from '@univerjs/core'; import { KeyCode } from '@univerjs/ui'; import { DeleteDrawingsCommand } from '../../commands/commands/delete-drawings.command'; import { MoveDrawingsCommand } from '../../commands/commands/move-drawings.command'; export function whenSheetDrawingFocused(contextService: IContextService): boolean { return ( + contextService.getContextValue(FOCUSING_SHEET) && !contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) && !contextService.getContextValue(EDITOR_ACTIVATED) && !contextService.getContextValue(FOCUSING_PANEL_EDITOR) &&