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 shortcut ctrl+enter (#5030)

wpxp1234563405651a903d
diff --git a/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts b/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
index a8647cf031..9235370cad 100644
--- a/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
+++ b/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
@@ -558,7 +558,7 @@ export class EditingRenderController extends Disposable {
: false;
if (snapshot && !(isEmpty && isCellImage)) {
- const res = await this._submitEdit(snapshot, keycode === (MetaKeys.CTRL_COMMAND | KeyCode.ENTER));
+ const res = await this._submitEdit(snapshot, keycode === (MetaKeys.CTRL_COMMAND | KeyCode.ENTER) || keycode === (MetaKeys.MAC_CTRL | KeyCode.ENTER));
if (res === false) return; // if the submit was rejected, don't move selection
}
diff --git a/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts b/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts
index b446944c37..63fe078f86 100644
--- a/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts
+++ b/packages/sheets-ui/src/controllers/shortcuts/editor.shortcut.ts
@@ -126,6 +126,7 @@ export const EditorCursorEscShortcut: IShortcutItem = {
export const EditorCursorCtrlEnterShortcut: IShortcutItem = {
id: SetCellEditVisibleOperation.id,
binding: KeyCode.ENTER | MetaKeys.CTRL_COMMAND,
+ mac: KeyCode.ENTER | MetaKeys.MAC_CTRL,
preconditions: (contextService) => whenEditorDidNotInputFormulaActivated(contextService),
staticParameters: {
visible: false,