Browse Source

fix: Fixed issue with alt+c shortcut

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

17
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) => {
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey
if (cmdOrCtrl) {
switch (e.key.toLowerCase()) {
case 's':
if (openedViewsTab.value !== 'field') return
e.preventDefault()
break
}
if (cmdOrCtrl && e.key.toLowerCase() === 's') {
if (openedViewsTab.value !== 'field') return
e.preventDefault()
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
e.preventDefault()
addField()
}
})

Loading…
Cancel
Save