Browse Source

Merge pull request #7243 from nocodb/nc-fix/misc-fixes-1

fix: Increased min height and added scroll for long text in expanded …
pull/7319/head
Raju Udava 11 months ago committed by GitHub
parent
commit
7b06258223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      packages/nc-gui/assets/style.scss
  2. 5
      packages/nc-gui/components/cell/RichText.vue
  3. 19
      packages/nc-gui/components/cell/TextArea.vue

26
packages/nc-gui/assets/style.scss

@ -57,7 +57,7 @@ main {
} }
.mobile { .mobile {
.nc-scrollbar-md, .nc-scrollbar-x-md, .nc-scrollbar-dark-md, .nc-scrollbar-x-md-dark, .nc-scrollbar-x-lg { .nc-scrollbar-md, .nc-scrollbar-lg, .nc-scrollbar-x-md, .nc-scrollbar-dark-md, .nc-scrollbar-x-md-dark, .nc-scrollbar-x-lg {
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 0px; width: 0px;
} }
@ -88,6 +88,30 @@ main {
} }
} }
.nc-scrollbar-lg {
overflow-y: scroll;
overflow-x: hidden;
scrollbar-width: thin !important;
&::-webkit-scrollbar {
width: 10px;
height: 10px;
}
&::-webkit-scrollbar-track-piece {
width: 0px;
}
&::-webkit-scrollbar {
@apply bg-transparent;
}
&::-webkit-scrollbar-thumb {
width: 4px;
@apply bg-gray-200;
}
&::-webkit-scrollbar-thumb:hover {
@apply bg-gray-300;
}
}
.nc-scrollbar-x-md { .nc-scrollbar-x-md {
overflow-x: scroll; overflow-x: scroll;
scrollbar-width: thin !important; scrollbar-width: thin !important;

5
packages/nc-gui/components/cell/RichText.vue

@ -19,6 +19,8 @@ const props = defineProps<{
const emits = defineEmits(['update:value']) const emits = defineEmits(['update:value'])
const isExpandedFormOpen = inject(IsExpandedFormOpenInj, ref(false))!
const turndownService = new TurndownService({}) const turndownService = new TurndownService({})
turndownService.addRule('lineBreak', { turndownService.addRule('lineBreak', {
@ -171,7 +173,8 @@ watch(editorDom, () => {
class="flex flex-col nc-textarea-rich-editor w-full" class="flex flex-col nc-textarea-rich-editor w-full"
:class="{ :class="{
'ml-1 mt-2.5 flex-grow': props.fullMode, 'ml-1 mt-2.5 flex-grow': props.fullMode,
'nc-scrollbar-md': !props.fullMode && !props.readonly, 'nc-scrollbar-md': (!props.fullMode && !props.readonly) || isExpandedFormOpen,
'flex-grow': isExpandedFormOpen,
}" }"
/> />
</div> </div>

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

@ -58,6 +58,8 @@ const isDragging = ref(false)
const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value && (el as HTMLTextAreaElement)?.focus() const focus: VNodeRef = (el) => !isExpandedFormOpen.value && !isEditColumn.value && (el as HTMLTextAreaElement)?.focus()
const height = computed(() => { const height = computed(() => {
if (isExpandedFormOpen.value) return 36 * 4
if (!rowHeight.value || rowHeight.value === 1) return 36 if (!rowHeight.value || rowHeight.value === 1) return 36
return rowHeight.value * 36 return rowHeight.value * 36
@ -169,16 +171,16 @@ watch(editEnabled, () => {
<template> <template>
<NcDropdown <NcDropdown
v-model:visible="isVisible" v-model:visible="isVisible"
class="overflow-visible" class="overflow-hidden group"
:trigger="[]" :trigger="[]"
placement="bottomLeft" placement="bottomLeft"
:overlay-class-name="isVisible ? 'nc-textarea-dropdown-active' : undefined" :overlay-class-name="isVisible ? 'nc-textarea-dropdown-active' : undefined"
> >
<div <div
class="flex flex-row pt-0.5 w-full rich-wrapper" class="flex flex-row pt-0.5 w-full rich-wrapper long-text-wrapper"
:class="{ :class="{
'min-h-10': rowHeight !== 1, 'min-h-10': rowHeight !== 1 || isExpandedFormOpen,
'min-h-6.5': rowHeight === 1, 'min-h-9': rowHeight === 1 && !isExpandedFormOpen,
'h-full': isForm, 'h-full': isForm,
}" }"
> >
@ -198,7 +200,7 @@ watch(editEnabled, () => {
:ref="focus" :ref="focus"
v-model="vModel" v-model="vModel"
rows="4" rows="4"
class="h-full w-full outline-none border-none" class="h-full w-full outline-none border-none nc-scrollbar-lg"
:class="{ :class="{
'p-2': editEnabled, 'p-2': editEnabled,
'py-1 h-full': isForm, 'py-1 h-full': isForm,
@ -240,7 +242,12 @@ watch(editEnabled, () => {
v-if="!isVisible" v-if="!isVisible"
placement="bottom" placement="bottom"
class="!absolute right-0 bottom-1 hidden nc-text-area-expand-btn" class="!absolute right-0 bottom-1 hidden nc-text-area-expand-btn"
:class="{ 'right-0 bottom-1': editEnabled, '!bottom-0': !isRichMode }" :class="{
'right-0 bottom-1': editEnabled,
'!bottom-0': !isRichMode,
'top-1 hidden !group-hover:block': isExpandedFormOpen,
'bottom-1': !isExpandedFormOpen,
}"
> >
<template #title>{{ $t('title.expand') }}</template> <template #title>{{ $t('title.expand') }}</template>
<NcButton type="secondary" size="xsmall" data-testid="attachment-cell-file-picker-button" @click.stop="onExpand"> <NcButton type="secondary" size="xsmall" data-testid="attachment-cell-file-picker-button" @click.stop="onExpand">

Loading…
Cancel
Save