From 84877e51b2a73eb6a8cab948c893a68bf8089baa Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 3 Feb 2023 11:21:36 +0530 Subject: [PATCH 1/3] fix(gui): on new row creation using shortcut set the first cell as active Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Grid.vue | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 5a08a9a925..2997582cf6 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -283,14 +283,6 @@ const { activeCell.row = data.value.length - 1 activeCell.col = 0 resetSelectedRange() - makeEditable(data.value[activeCell.row], fields.value[activeCell.col]) - nextTick(() => { - ;( - document.querySelector('td.cell.active')?.querySelector('input,textarea') as - | HTMLInputElement - | HTMLTextAreaElement - )?.focus() - }) } break } From e5ef00f1b3c39892366fdb5c8f24f47e6ae66378 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 3 Feb 2023 11:23:02 +0530 Subject: [PATCH 2/3] fix(gui): scroll to active cell Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Grid.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 2997582cf6..644cd28bb9 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -283,6 +283,12 @@ const { activeCell.row = data.value.length - 1 activeCell.col = 0 resetSelectedRange() + nextTick(() => { + ;(document.querySelector('td.cell.active') as + | HTMLInputElement + | HTMLTextAreaElement + )?.scrollIntoView({ behavior: 'smooth' }) + }) } break } From f92c68561cfe36fc095c3fb674a0ee35ab68e8ba Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 3 Feb 2023 11:25:30 +0530 Subject: [PATCH 3/3] chore(gui): lint Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Grid.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 644cd28bb9..db9ce5f061 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -284,10 +284,9 @@ const { activeCell.col = 0 resetSelectedRange() nextTick(() => { - ;(document.querySelector('td.cell.active') as - | HTMLInputElement - | HTMLTextAreaElement - )?.scrollIntoView({ behavior: 'smooth' }) + ;(document.querySelector('td.cell.active') as HTMLInputElement | HTMLTextAreaElement)?.scrollIntoView({ + behavior: 'smooth', + }) }) } break