From ff321d43c18825f57388a7820ccff1ecea9a2e68 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 17 Jun 2023 17:18:24 +0530 Subject: [PATCH] fix: expand only on second click and show plus icon only on hover Signed-off-by: Pranav C --- .../nc-gui/components/virtual-cell/Links.vue | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/components/virtual-cell/Links.vue b/packages/nc-gui/components/virtual-cell/Links.vue index dd82257fa6..95bf5947e9 100644 --- a/packages/nc-gui/components/virtual-cell/Links.vue +++ b/packages/nc-gui/components/virtual-cell/Links.vue @@ -2,7 +2,7 @@ import { computed } from '@vue/reactivity' import type { ColumnType } from 'nocodb-sdk' import type { Ref } from 'vue' -import { CellValueInj, ColumnInj, inject, useSelectedCellKeyupListener } from '#imports' +import { ActiveCellInj, CellValueInj, ColumnInj, EditModeInj, MetaInj, inject, useSelectedCellKeyupListener } from '#imports' const value = inject(CellValueInj) @@ -20,10 +20,14 @@ const isForm = inject(IsFormInj) const readOnly = inject(ReadonlyInj, ref(false)) -const isLocked = inject(IsLockedInj) +const isLocked = inject(IsLockedInj, ref(false)) const isUnderLookup = inject(IsUnderLookupInj, ref(false)) +const active = inject(ActiveCellInj, ref(false)) + +const editable = inject(EditModeInj, ref(false)) + const listItemsDlg = ref(false) const childListDlg = ref(false) @@ -61,7 +65,9 @@ const onAttachRecord = () => { } const openChildList = () => { - if (!isLocked.value) childListDlg.value = true + if (!isLocked.value && (editable.value || active.value)) { + childListDlg.value = true + } } useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEvent) => { @@ -76,7 +82,7 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven