From b9eafb04e7a68c126f3dd2fbff16e117458b8788 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 7 Aug 2022 23:50:36 +0530 Subject: [PATCH] refactor(gui-v2): enter key navigation correction Signed-off-by: Pranav C --- packages/nc-gui-v2/components/smartsheet/Grid.vue | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Grid.vue b/packages/nc-gui-v2/components/smartsheet/Grid.vue index e9547fc51f..01ed8dd11b 100644 --- a/packages/nc-gui-v2/components/smartsheet/Grid.vue +++ b/packages/nc-gui-v2/components/smartsheet/Grid.vue @@ -5,7 +5,6 @@ import { isVirtualCol } from 'nocodb-sdk' import { message } from 'ant-design-vue' import { inject, - onKeyStroke, onMounted, onUnmounted, provide, @@ -18,7 +17,6 @@ import type { Row } from '~/composables' import { ActiveViewInj, ChangePageInj, - EditModeInj, FieldsInj, IsFormInj, IsGridInj, @@ -247,19 +245,13 @@ const onNavigate = (dir: NavigateDir) => { if (selected.row === null || selected.col === null) return switch (dir) { case NavigateDir.NEXT: - if (selected.col < visibleColLength - 1) { - selected.col++ - } else if (selected.row < data.value.length - 1) { + if (selected.row < data.value.length - 1) { selected.row++ - selected.col = 0 } break case NavigateDir.PREV: - if (selected.col > 0) { - selected.col-- - } else if (selected.row > 0) { + if (selected.row > 0) { selected.row-- - selected.col = visibleColLength - 1 } break }