diff --git a/packages/nc-gui/components/virtual-cell/Lookup.vue b/packages/nc-gui/components/virtual-cell/Lookup.vue index 2003dc4ead..87dd4080be 100644 --- a/packages/nc-gui/components/virtual-cell/Lookup.vue +++ b/packages/nc-gui/components/virtual-cell/Lookup.vue @@ -25,6 +25,14 @@ const meta = inject(MetaInj, ref()) const cellValue = inject(CellValueInj, ref()) +// Change the row height of the child cell under lookup +// Other wise things like text will can take multi line tag +const providedHeightRef = ref(1) as any + +const rowHeight = inject(RowHeightInj, ref(1) as any) + +provide(RowHeightInj, providedHeightRef) + const relationColumn = computed( () => meta.value?.columns?.find((c: ColumnType) => c.id === (column.value?.colOptions as LookupType)?.fk_relation_column_id) as @@ -56,6 +64,14 @@ const lookupColumn = computed( | undefined, ) +watch([lookupColumn, rowHeight], () => { + if (lookupColumn.value && !isAttachment(lookupColumn.value)) { + providedHeightRef.value = 1 + } else { + providedHeightRef.value = rowHeight.value + } +}) + const arrValue = computed(() => { if (!cellValue.value) return [] @@ -64,7 +80,8 @@ const arrValue = computed(() => { if (lookupColumn.value?.uidt === UITypes.Attachment && relationColumn.value?.colOptions?.type === RelationTypes.BELONGS_TO) return [cellValue.value] - if (Array.isArray(cellValue.value)) return cellValue.value + // TODO: We are filtering null as cell value can be null. Find the root cause and fix it + if (Array.isArray(cellValue.value)) return cellValue.value.filter((v) => v !== null) return [cellValue.value] }) @@ -80,8 +97,17 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activ