Browse Source

fix: Fixed issue with alt+c shortcut

pull/6861/head
Muhammed Mustafa 1 year ago
parent
commit
cd8200b965
  1. 13
      packages/nc-gui/components/smartsheet/details/Fields.vue

13
packages/nc-gui/components/smartsheet/details/Fields.vue

@ -583,19 +583,18 @@ const toggleVisibility = async (checked: boolean, field: Field) => {
useEventListener(document, 'keydown', async (e: KeyboardEvent) => { useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey
if (cmdOrCtrl) { if (cmdOrCtrl && e.key.toLowerCase() === 's') {
switch (e.key.toLowerCase()) {
case 's':
if (openedViewsTab.value !== 'field') return if (openedViewsTab.value !== 'field') return
e.preventDefault() e.preventDefault()
break
} return
} }
if (e.altKey && e.code === 'KeyC') { // For Windows and mac
if ((e.altKey && e.key.toLowerCase() === 'c') || (e.altKey && e.code === 'KeyC')) {
if (openedViewsTab.value !== 'field') return if (openedViewsTab.value !== 'field') return
e.preventDefault() e.preventDefault()
addField() addField()
} }
}) })

Loading…
Cancel
Save