Browse Source

fix(nc-gui): prevent ctrl+s keypress in formview

pull/7741/head
Ramesh Mane 9 months ago
parent
commit
852016885d
  1. 24
      packages/nc-gui/components/smartsheet/Form.vue

24
packages/nc-gui/components/smartsheet/Form.vue

@ -612,6 +612,30 @@ useEventListener(
},
true,
)
useEventListener(
document,
'keydown',
(e: KeyboardEvent) => {
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey
switch (e.key.toLowerCase()) {
case 's':
if (
cmdOrCtrl &&
!(
['input', 'textarea'].includes((e.target as any).nodeName.toLowerCase()) ||
(e.target as any)?.getAttribute('contenteditable')
)
) {
e.preventDefault()
updateView()
}
break
}
},
true,
)
</script>
<template>

Loading…
Cancel
Save