Browse Source

feat(nc-gui): prevent shift / cntOrCtrl key is pressing for altKey cases

pull/4482/head
Wing-Kam Wong 2 years ago
parent
commit
04687e02ae
  1. 4
      packages/nc-gui/components/dashboard/TreeView.vue
  2. 5
      packages/nc-gui/components/general/FullScreen.vue
  3. 5
      packages/nc-gui/components/general/ShareBaseButton.vue
  4. 1
      packages/nc-gui/components/smartsheet/expanded-form/Header.vue
  5. 4
      packages/nc-gui/pages/[projectType]/[projectId]/index.vue

4
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

5
packages/nc-gui/components/general/FullScreen.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, useSidebar } from '#imports'
import { computed, isMac, useSidebar } from '#imports'
const rightSidebar = useSidebar('nc-right-sidebar')
@ -14,7 +14,8 @@ const isSidebarsOpen = computed({
})
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 70: {
// ALT + F

5
packages/nc-gui/components/general/ShareBaseButton.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
import { useRoute, useUIPermission } from '#imports'
import { isMac, useRoute, useUIPermission } from '#imports'
const route = useRoute()
@ -17,7 +17,8 @@ const isShareBaseAllowed = computed(
)
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 73: {
// ALT + I

1
packages/nc-gui/components/smartsheet/expanded-form/Header.vue

@ -3,6 +3,7 @@ import { message } from 'ant-design-vue'
import type { ViewType } from 'nocodb-sdk'
import {
ReloadRowDataHookInj,
isMac,
useExpandedFormStoreOrThrow,
useSmartsheetRowStoreOrThrow,
useSmartsheetStoreOrThrow,

4
packages/nc-gui/pages/[projectType]/[projectId]/index.vue

@ -3,6 +3,7 @@ import tinycolor from 'tinycolor2'
import {
computed,
definePageMeta,
isMac,
message,
navigateTo,
onBeforeMount,
@ -184,7 +185,8 @@ onMounted(() => {
onBeforeUnmount(reset)
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 188: {
// ALT + ,

Loading…
Cancel
Save