From cd56d6bf1e53e2f24d92138097554adee884c9ba Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 28 Nov 2022 16:28:26 +0800 Subject: [PATCH] feat(nc-gui): click enter to open modal, click enter again to attach file --- packages/nc-gui/components/cell/attachment/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/cell/attachment/index.vue b/packages/nc-gui/components/cell/attachment/index.vue index 1ce6ec6a51..7a4e99a315 100644 --- a/packages/nc-gui/components/cell/attachment/index.vue +++ b/packages/nc-gui/components/cell/attachment/index.vue @@ -150,7 +150,12 @@ watch( useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e) => { if (e.key === 'Enter' && !isReadonly.value) { e.stopPropagation() - modalVisible.value = true + if (!modalVisible.value) { + modalVisible.value = true + } else { + // click Attach File button + ;(document.querySelector('.nc-attachment-modal.active .nc-attach-file') as HTMLDivElement)?.click() + } } })