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