From 55fae33841076870f0b4fee00068f75ce89f2757 Mon Sep 17 00:00:00 2001
From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com>
Date: Tue, 10 Dec 2024 07:28:44 +0000
Subject: [PATCH 1/5] fix(nc-gui): longtext cell focus issue on cell active
---
packages/nc-gui/components/cell/TextArea.vue | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue
index c51602a5c5..0ffed54ba7 100644
--- a/packages/nc-gui/components/cell/TextArea.vue
+++ b/packages/nc-gui/components/cell/TextArea.vue
@@ -1,5 +1,4 @@
@@ -394,7 +398,7 @@ watch(
}"
>
{
const size = event.detail.split('px')[0]
gridViewCols.value[cn].width = `${normalizedWidth(metaColumnById.value[cn], size)}px`
+
+ refreshFillHandle()
}
const onXcStartResizing = (cn: string | undefined, event: any) => {
@@ -1376,7 +1378,7 @@ const topOffset = computed(() => {
const fillHandleTop = ref()
const fillHandleLeft = ref()
-const refreshFillHandle = () => {
+function refreshFillHandle() {
nextTick(() => {
const rowIndex = isNaN(selectedRange.end.row) ? activeCell.row : selectedRange.end.row
const colIndex = isNaN(selectedRange.end.col) ? activeCell.col : selectedRange.end.col
@@ -1834,7 +1836,7 @@ onKeyStroke('ArrowDown', onDown)
|
= {
6: 120,
}
-export const rowHeightTruncateLines = (rowHeight?: number) => {
+export const rowHeightTruncateLines = (rowHeight?: number, isSelectOption = false) => {
switch (rowHeight) {
case 2:
- return 3
+ return 2
case 4:
- return 4
+ return isSelectOption ? 3 : 4
case 6:
- return 6
+ return isSelectOption ? 4 : 6
default:
return 1
}
From f5ece079f7c47258b7e52a533b7e14b6ed9cc01c Mon Sep 17 00:00:00 2001
From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com>
Date: Tue, 10 Dec 2024 07:28:44 +0000
Subject: [PATCH 5/5] fix(nc-gui): remove cell padding from text area cell
---
packages/nc-gui/components/cell/TextArea.vue | 4 ++--
.../components/smartsheet/grid/InfiniteTable.vue | 14 +++++---------
.../nc-gui/components/smartsheet/grid/Table.vue | 14 +++++---------
3 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue
index 4df3a62730..e1e1436b57 100644
--- a/packages/nc-gui/components/cell/TextArea.vue
+++ b/packages/nc-gui/components/cell/TextArea.vue
@@ -515,8 +515,8 @@ watch(textAreaRef, (el) => {
:class="{
'right-1': isForm,
'right-0': !isForm,
- 'top-0 ': isGrid && !isExpandedFormOpen && !isForm,
- '!right-2 ': isGrid && !isExpandedFormOpen && !isForm && ((editEnabled && !isVisible) || isForm),
+ 'top-0 right-1': isGrid && !isExpandedFormOpen && !isForm,
+ '!right-2 top-2': isGrid && !isExpandedFormOpen && !isForm && ((editEnabled && !isVisible) || isForm),
'top-1': !(isGrid && !isExpandedFormOpen && !isForm),
}"
>
diff --git a/packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue b/packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue
index cc43827cc9..f890f554f7 100644
--- a/packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue
+++ b/packages/nc-gui/components/smartsheet/grid/InfiniteTable.vue
@@ -2727,16 +2727,16 @@ watch(vSelectedAllRecords, (selectedAll) => {
&.align-top {
@apply py-2;
- &:has(.nc-cell textarea) {
- @apply pr-0;
+ &:has(.nc-cell.nc-cell-longtext textarea) {
+ @apply py-0 pr-0;
}
}
&.align-middle {
@apply py-0;
- &:has(.nc-cell textarea) {
- @apply py-2 pr-0;
+ &:has(.nc-cell.nc-cell-longtext textarea) {
+ @apply pr-0;
}
}
@@ -2760,10 +2760,6 @@ watch(vSelectedAllRecords, (selectedAll) => {
:deep(.nc-virtual-cell) {
@apply !text-small;
- textarea {
- @apply !pr-8;
- }
-
.nc-cell-field,
input,
textarea {
@@ -2800,7 +2796,7 @@ watch(vSelectedAllRecords, (selectedAll) => {
@apply leading-[18px];
textarea {
- @apply pr-2;
+ @apply pr-8 !py-2;
}
}
diff --git a/packages/nc-gui/components/smartsheet/grid/Table.vue b/packages/nc-gui/components/smartsheet/grid/Table.vue
index 79c6ec5cba..eb6739065f 100644
--- a/packages/nc-gui/components/smartsheet/grid/Table.vue
+++ b/packages/nc-gui/components/smartsheet/grid/Table.vue
@@ -2742,16 +2742,16 @@ onKeyStroke('ArrowDown', onDown)
&.align-top {
@apply py-2;
- &:has(.nc-cell textarea) {
- @apply pr-0;
+ &:has(.nc-cell.nc-cell-longtext textarea) {
+ @apply py-0 pr-0;
}
}
&.align-middle {
@apply py-0;
- &:has(.nc-cell textarea) {
- @apply py-2 pr-0;
+ &:has(.nc-cell.nc-cell-longtext textarea) {
+ @apply pr-0;
}
}
@@ -2775,10 +2775,6 @@ onKeyStroke('ArrowDown', onDown)
:deep(.nc-virtual-cell) {
@apply !text-small;
- textarea {
- @apply !pr-8;
- }
-
.nc-cell-field,
input,
textarea {
@@ -2815,7 +2811,7 @@ onKeyStroke('ArrowDown', onDown)
@apply leading-[18px];
textarea {
- @apply pr-2;
+ @apply pr-8 !py-2;
}
}
|