Browse Source

fix: Added click on text area to open expanded long text view and text area can be expanded on expanded form

pull/7046/head
Muhammed Mustafa 12 months ago
parent
commit
3bf96a2559
  1. 21
      packages/nc-gui/components/cell/TextArea.vue

21
packages/nc-gui/components/cell/TextArea.vue

@ -84,12 +84,6 @@ const isRichMode = computed(() => {
return meta?.richMode return meta?.richMode
}) })
watch(editEnabled, () => {
if (editEnabled.value && isRichMode.value) {
isVisible.value = true
}
})
</script> </script>
<template> <template>
@ -104,11 +98,12 @@ watch(editEnabled, () => {
> >
<div <div
v-if="isRichMode" v-if="isRichMode"
class="w-full" class="w-full cursor-pointer"
:style="{ :style="{
maxHeight: `${height}px !important`, maxHeight: `${height}px !important`,
minHeight: `${height}px !important`, minHeight: `${height}px !important`,
}" }"
@click="isVisible = true"
> >
<LazyCellRichText v-model:value="vModel" sync-value-change readonly class="!pointer-events-none" /> <LazyCellRichText v-model:value="vModel" sync-value-change readonly class="!pointer-events-none" />
</div> </div>
@ -156,10 +151,9 @@ watch(editEnabled, () => {
<span v-else>{{ vModel }}</span> <span v-else>{{ vModel }}</span>
<NcTooltip <NcTooltip
v-if="active && !isExpandedFormOpen"
placement="bottom" placement="bottom"
class="!absolute right-0 bottom-1" class="!absolute right-0 bottom-1 !hidden nc-text-area-expand-btn"
:class="{ 'right-2 bottom-2': editEnabled }" :class="{ 'right-0 bottom-2': editEnabled }"
> >
<template #title>{{ $t('title.expand') }}</template> <template #title>{{ $t('title.expand') }}</template>
<NcButton <NcButton
@ -212,6 +206,7 @@ watch(editEnabled, () => {
}" }"
show-menu show-menu
full-mode full-mode
:read-only="readOnly"
/> />
</div> </div>
</template> </template>
@ -222,4 +217,10 @@ watch(editEnabled, () => {
textarea:focus { textarea:focus {
box-shadow: none; box-shadow: none;
} }
.nc-grid-cell:hover {
.nc-text-area-expand-btn {
@apply !block;
}
}
</style> </style>

Loading…
Cancel
Save