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 {
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
}

Loading…
Cancel
Save