Browse Source

Merge pull request #4025 from nocodb/feat/4018-navigate

feat: automatically create a new row on navigating next within last row
pull/4027/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
859d57d794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/smartsheet/Cell.vue
  2. 5
      packages/nc-gui/components/smartsheet/Grid.vue

2
packages/nc-gui/components/smartsheet/Cell.vue

@ -126,7 +126,7 @@ const {
const syncAndNavigate = (dir: NavigateDir, e: KeyboardEvent) => {
if (isJSON.value) return
if (currentRow.value.rowMeta.changed) {
if (currentRow.value.rowMeta.changed || currentRow.value.rowMeta.new) {
emit('save')
currentRow.value.rowMeta.changed = false
}

5
packages/nc-gui/components/smartsheet/Grid.vue

@ -235,7 +235,8 @@ const onNavigate = (dir: NavigateDir) => {
if (selected.row < data.value.length - 1) {
selected.row++
} else {
editEnabled = false
addEmptyRow()
selected.row++
}
break
case NavigateDir.PREV:
@ -292,7 +293,7 @@ async function reloadViewDataHandler(shouldShowLoading: boolean | void) {
}
async function openNewRecordHandler() {
const newRow = await addEmptyRow()
const newRow = addEmptyRow()
expandForm(newRow, undefined, true)
}

Loading…
Cancel
Save