diff --git a/packages/nc-gui/components/cell/RichText.vue b/packages/nc-gui/components/cell/RichText.vue index 96819394fc..86799bc616 100644 --- a/packages/nc-gui/components/cell/RichText.vue +++ b/packages/nc-gui/components/cell/RichText.vue @@ -172,7 +172,7 @@ watch(editorDom, () => { }" tabindex="0" > -
+
@@ -220,8 +220,8 @@ watch(editorDom, () => { .nc-textarea-rich-editor { .ProseMirror { - @apply flex-grow pt-1 border-1 border-gray-200 rounded-lg pr-1 mr-2; - + @apply flex-grow pt-1 border-1 border-gray-200 rounded-lg pr-1 mr-2 h-[215px]; + resize: vertical; > * { @apply ml-1; } @@ -335,36 +335,9 @@ watch(editorDom, () => { .nc-rich-text-full { .ProseMirror { - overflow-y: scroll; + overflow-y: auto; overflow-x: hidden; scrollbar-width: thin !important; - - &::-webkit-scrollbar { - width: 4px; - height: 4px; - } - &::-webkit-scrollbar-track { - -webkit-border-radius: 10px; - border-radius: 10px; - margin-top: 4px; - margin-bottom: 4px; - } - &::-webkit-scrollbar-track-piece { - width: 0px; - } - &::-webkit-scrollbar { - @apply bg-transparent; - } - &::-webkit-scrollbar-thumb { - -webkit-border-radius: 10px; - border-radius: 10px; - - width: 4px; - @apply bg-gray-300; - } - &::-webkit-scrollbar-thumb:hover { - @apply bg-gray-400; - } } } diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index 88b6dfb8bc..b37d5470e9 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -48,10 +48,7 @@ const position = ref< left: number } | undefined ->({ - top: 200, - left: 600, -}) +>() const isDragging = ref(false) @@ -107,14 +104,8 @@ const isRichMode = computed(() => { }) const onExpand = () => { + if (readOnly?.value) return isVisible.value = true - - const { top, left } = inputWrapperRef.value?.getBoundingClientRect() ?? { top: 0, left: 0 } - - position.value = { - top: top + 42, - left, - } } const onMouseMove = (e: MouseEvent) => { @@ -140,20 +131,24 @@ const onMouseUp = (e: MouseEvent) => { document.removeEventListener('mouseup', onMouseUp) } -watch(position, () => { - const dom = document.querySelector('.nc-textarea-dropdown-active') as HTMLElement - if (!dom) return +watch( + position, + () => { + const dom = document.querySelector('.nc-long-text-expanded-modal .ant-modal-content') as HTMLElement + if (!dom) return - if (!position.value) return - - // Set left and top of dom - setTimeout(() => { if (!position.value) return - dom.style.left = `${position.value.left}px` - dom.style.top = `${position.value.top}px` - }, 1) -}) + // Set left and top of dom + setTimeout(() => { + if (!position.value) return + + dom.style.left = `${position.value.left}px` + dom.style.top = `${position.value.top}px` + }, 1) + }, + { deep: true }, +) const dragStart = () => { document.addEventListener('mousemove', onMouseMove) @@ -170,13 +165,7 @@ watch(editEnabled, () => {