Skip to content

Commit

Permalink
fix(editor): formula input esc invalid (#1902)
Browse files Browse the repository at this point in the history
  • Loading branch information
DR-Univer authored Apr 14, 2024
1 parent 4a5eca1 commit 87f0994
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/sheets-formula/src/controllers/prompt.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,19 @@ export class PromptController extends Disposable {
return;
}

if (keycode === KeyCode.ESC) {
const focusEditor = this._editorService.getFocusEditor();
if (focusEditor && focusEditor.isSheetEditor() === true) {
this._editorBridgeService.changeVisible({
visible: false,
eventType: DeviceInputEventType.Keyboard,
keycode,
});
this._selectionManagerService.refreshSelection();
}
return;
}

if (this._formulaPromptService.isSearching()) {
if (keycode === KeyCode.ARROW_DOWN) {
this._formulaPromptService.navigate({ direction: Direction.DOWN });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const PROMPT_SELECTION_KEYCODE_ARROW_LIST = [
KeyCode.ARROW_RIGHT,
];

export const PROMPT_SELECTION_KEYCODE_LIST = [...PROMPT_SELECTION_KEYCODE_ARROW_LIST, KeyCode.ENTER, KeyCode.TAB];
export const PROMPT_SELECTION_KEYCODE_LIST = [...PROMPT_SELECTION_KEYCODE_ARROW_LIST, KeyCode.ENTER, KeyCode.TAB, KeyCode.ESC];

export function promptSelectionShortcutItem() {
const shortcutList: IShortcutItem[] = [];
Expand Down

0 comments on commit 87f0994

Please sign in to comment.