From 8d07caf5412018a5a84be4d665b88f2fd7cf4468 Mon Sep 17 00:00:00 2001
From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com>
Date: Wed, 17 Jan 2024 07:24:58 +0000
Subject: [PATCH] fix(nc-gui): show truncated text in readonly rich text cell
---
packages/nc-gui/components/cell/RichText.vue | 35 +++++++++++++------
packages/nc-gui/components/cell/TextArea.vue | 9 ++---
.../virtual-cell/components/ListItem.vue | 11 ++++++
3 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/packages/nc-gui/components/cell/RichText.vue b/packages/nc-gui/components/cell/RichText.vue
index de8ea395f7..3a4d7051de 100644
--- a/packages/nc-gui/components/cell/RichText.vue
+++ b/packages/nc-gui/components/cell/RichText.vue
@@ -8,6 +8,7 @@ import { generateJSON } from '@tiptap/html'
import Underline from '@tiptap/extension-underline'
import { TaskItem } from '@/helpers/dbTiptapExtensions/task-item'
import { Link } from '@/helpers/dbTiptapExtensions/links'
+import { RowHeightInj, IsExpandedFormOpenInj } from '#imports'
const props = defineProps<{
value?: string | null
@@ -21,6 +22,8 @@ const emits = defineEmits(['update:value'])
const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
+const rowHeight = inject(RowHeightInj, ref(1 as const))
+
const turndownService = new TurndownService({})
turndownService.addRule('lineBreak', {
@@ -169,6 +172,7 @@ watch(editorDom, () => {
:class="{
'flex flex-col flex-grow nc-rich-text-full': props.fullMode,
'nc-rich-text-embed flex flex-col pl-1 w-full': !props.fullMode,
+ 'readonly': props.readonly,
}"
tabindex="0"
>
@@ -180,11 +184,13 @@ watch(editorDom, () => {