From efd76975461ea4f584b92b82e92dfa374bb8dee7 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 24 Nov 2022 13:31:30 +0800 Subject: [PATCH] feat(nc-gui): keyboard manoeuvre - cmd/ctrl + Enter --- .../components/smartsheet/expanded-form/Header.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/nc-gui/components/smartsheet/expanded-form/Header.vue b/packages/nc-gui/components/smartsheet/expanded-form/Header.vue index 5141bc8313..875d8cab10 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/Header.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/Header.vue @@ -58,6 +58,19 @@ const copyRecordUrl = () => { ) message.success('Copied to clipboard') } + +useEventListener(document, 'keydown', async (e: KeyboardEvent) => { + const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey + if (cmdOrCtrl) { + switch (e.key) { + case 'Enter': { + if (isUIAllowed('tableRowUpdate')) { + await save() + } + } + } + } +})