Browse Source

refactor(gui-v2): enter key navigation correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3005/head
Pranav C 2 years ago
parent
commit
b9eafb04e7
  1. 12
      packages/nc-gui-v2/components/smartsheet/Grid.vue

12
packages/nc-gui-v2/components/smartsheet/Grid.vue

@ -5,7 +5,6 @@ import { isVirtualCol } from 'nocodb-sdk'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { import {
inject, inject,
onKeyStroke,
onMounted, onMounted,
onUnmounted, onUnmounted,
provide, provide,
@ -18,7 +17,6 @@ import type { Row } from '~/composables'
import { import {
ActiveViewInj, ActiveViewInj,
ChangePageInj, ChangePageInj,
EditModeInj,
FieldsInj, FieldsInj,
IsFormInj, IsFormInj,
IsGridInj, IsGridInj,
@ -247,19 +245,13 @@ const onNavigate = (dir: NavigateDir) => {
if (selected.row === null || selected.col === null) return if (selected.row === null || selected.col === null) return
switch (dir) { switch (dir) {
case NavigateDir.NEXT: case NavigateDir.NEXT:
if (selected.col < visibleColLength - 1) { if (selected.row < data.value.length - 1) {
selected.col++
} else if (selected.row < data.value.length - 1) {
selected.row++ selected.row++
selected.col = 0
} }
break break
case NavigateDir.PREV: case NavigateDir.PREV:
if (selected.col > 0) { if (selected.row > 0) {
selected.col--
} else if (selected.row > 0) {
selected.row-- selected.row--
selected.col = visibleColLength - 1
} }
break break
} }

Loading…
Cancel
Save