Browse Source

Merge pull request #5011 from nocodb/fix/5006-allow-new-row-shortcut

fix(gui): on new row creation using shortcut set the first cell as active
pull/5015/head
Raju Udava 2 years ago committed by GitHub
parent
commit
e04359601a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      packages/nc-gui/components/smartsheet/Grid.vue

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

@ -283,13 +283,10 @@ 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()
;(document.querySelector('td.cell.active') as HTMLInputElement | HTMLTextAreaElement)?.scrollIntoView({
behavior: 'smooth',
})
})
}
break

Loading…
Cancel
Save