From 4b0845bd302c51f538d1dd7c02fa005ace8a88e6 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 29 Oct 2022 15:13:13 +0530 Subject: [PATCH] feat(gui): on enter key press open ref table rows modal for LTAR cells Signed-off-by: Pranav C --- packages/nc-gui/components/virtual-cell/BelongsTo.vue | 10 ++++++++++ packages/nc-gui/components/virtual-cell/HasMany.vue | 10 ++++++++++ .../nc-gui/components/virtual-cell/ManyToMany.vue | 11 +++++++++++ .../components/virtual-cell/components/ListItems.vue | 9 +++++++++ .../composables/useSelectedCellKeyupListener/index.ts | 2 +- 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/virtual-cell/BelongsTo.vue b/packages/nc-gui/components/virtual-cell/BelongsTo.vue index 8a2eaed14f..f2bc101d45 100644 --- a/packages/nc-gui/components/virtual-cell/BelongsTo.vue +++ b/packages/nc-gui/components/virtual-cell/BelongsTo.vue @@ -17,6 +17,7 @@ import { useProvideLTARStore, useSmartsheetRowStoreOrThrow, useUIPermission, + useSelectedCellKeyupListener } from '#imports' import MdiArrowExpand from '~icons/mdi/arrow-expand' import MdiPlus from '~icons/mdi/plus' @@ -70,6 +71,15 @@ const unlinkRef = async (rec: Record) => { await unlink(rec) } } + +useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { + switch (e.key) { + case 'Enter': + listItemsDlg.value = true + e.preventDefault() + break + } +})