From e8ab7d2d063c54d9a3487fa7414ac7b596d2419b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 21 Jun 2023 18:23:19 +0530 Subject: [PATCH] fix: make chip component readonly in Listitem Signed-off-by: Pranav C --- .../nc-gui/components/virtual-cell/components/ItemChip.vue | 5 +++-- .../nc-gui/components/virtual-cell/components/ListItems.vue | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/virtual-cell/components/ItemChip.vue b/packages/nc-gui/components/virtual-cell/components/ItemChip.vue index a1afc98d60..232271dfaa 100644 --- a/packages/nc-gui/components/virtual-cell/components/ItemChip.vue +++ b/packages/nc-gui/components/virtual-cell/components/ItemChip.vue @@ -19,9 +19,10 @@ interface Props { column: any showUnlinkButton: boolean border?: boolean + readonly?: boolean } -const { value, item, column, showUnlinkButton, border = true } = defineProps() +const { value, item, column, showUnlinkButton, border = true, readonly: readonlyProp } = defineProps() const emit = defineEmits(['unlink']) @@ -40,7 +41,7 @@ const isLocked = inject(IsLockedInj, ref(false)) const { open } = useExpandedFormDetached() function openExpandedForm() { - if (!readOnly.value && !isLocked.value) { + if (!readOnly.value && !isLocked.value && !readonlyProp) { open({ isOpen: true, row: { row: item, rowMeta: {}, oldRow: { ...item } }, diff --git a/packages/nc-gui/components/virtual-cell/components/ListItems.vue b/packages/nc-gui/components/virtual-cell/components/ListItems.vue index bd9d4ba6c6..20966329a5 100644 --- a/packages/nc-gui/components/virtual-cell/components/ListItems.vue +++ b/packages/nc-gui/components/virtual-cell/components/ListItems.vue @@ -234,6 +234,7 @@ watch(vModel, (nextVal) => { :column="props.column" :show-unlink-button="false" :border="false" + readonly />