Browse Source

feat(gui): open attchment modal on enter key press

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4222/head
Pranav C 2 years ago
parent
commit
230cd2bff0
  1. 9
      packages/nc-gui/components/cell/attachment/index.vue

9
packages/nc-gui/components/cell/attachment/index.vue

@ -1,5 +1,7 @@
<script setup lang="ts">
import { onKeyDown } from '@vueuse/core'
import { useSelectedCellKeyupListener } from '~/composables/useSelectedCellKeyupListener'
import { ActiveCellInj } from '~/context'
import { useProvideAttachmentCell } from './utils'
import { useSortable } from './sort'
import {
@ -136,6 +138,13 @@ watch(
rowState.value[column.value!.title!] = storedFiles.value
},
)
useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e) => {
if (e.key === 'Enter' && !isReadonly.value) {
e.stopPropagation()
modalVisible.value = true
}
})
</script>
<template>

Loading…
Cancel
Save