Browse Source

refactor(nc-gui): use e.key instead

pull/5342/head
Wing-Kam Wong 2 years ago
parent
commit
033d27457e
  1. 4
      packages/nc-gui/app.vue

4
packages/nc-gui/app.vue

@ -10,8 +10,8 @@ useTheme()
useEventListener(document, 'keydown', async (e: KeyboardEvent) => {
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey
if (cmdOrCtrl) {
switch (e.code) {
case 'KeyA':
switch (e.key.toLowerCase()) {
case 'a':
// prevent Ctrl + A selection for non-editable nodes
if (!['input', 'textarea'].includes((e.target as any).nodeName.toLowerCase())) {
e.preventDefault()

Loading…
Cancel
Save