From 04687e02ae70146a282ef0e2a17ef3f4a0846bbb Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 28 Nov 2022 18:58:13 +0800 Subject: [PATCH] feat(nc-gui): prevent shift / cntOrCtrl key is pressing for altKey cases --- packages/nc-gui/components/dashboard/TreeView.vue | 4 +++- packages/nc-gui/components/general/FullScreen.vue | 5 +++-- packages/nc-gui/components/general/ShareBaseButton.vue | 5 +++-- .../nc-gui/components/smartsheet/expanded-form/Header.vue | 1 + packages/nc-gui/pages/[projectType]/[projectId]/index.vue | 4 +++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/dashboard/TreeView.vue b/packages/nc-gui/components/dashboard/TreeView.vue index 06356f3ef0..23090adc02 100644 --- a/packages/nc-gui/components/dashboard/TreeView.vue +++ b/packages/nc-gui/components/dashboard/TreeView.vue @@ -7,6 +7,7 @@ import type { VNodeRef } from '#imports' import { Empty, computed, + isMac, reactive, ref, resolveComponent, @@ -218,7 +219,8 @@ const onSearchCloseIconClick = () => { } useEventListener(document, 'keydown', async (e: KeyboardEvent) => { - if (e.altKey) { + const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey + if (e.altKey && !e.shiftKey && !cmdOrCtrl) { switch (e.keyCode) { case 84: { // ALT + T diff --git a/packages/nc-gui/components/general/FullScreen.vue b/packages/nc-gui/components/general/FullScreen.vue index 34d01ecf73..5b7816e838 100644 --- a/packages/nc-gui/components/general/FullScreen.vue +++ b/packages/nc-gui/components/general/FullScreen.vue @@ -1,5 +1,5 @@