Browse Source

fix: on escape key press toggle to readonly

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

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

@ -162,7 +162,6 @@ const getContainerScrollForElement = (
return scroll
}
const { selectCell, selectBlock, selectedRange, clearRangeRows, startSelectRange, selected } = useMultiSelect(
fields,
data,
@ -183,13 +182,18 @@ const { selectCell, selectBlock, selectedRange, clearRangeRows, startSelectRange
}
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey
if (e.code === 'Space') {
if (e.key === ' ') {
if (selected.row !== null && !editEnabled) {
e.preventDefault()
const row = data.value[selected.row]
expandForm(row)
return true
}
} else if (e.key === 'Escape') {
if (editEnabled) {
editEnabled = false
return true
}
}
if (cmdOrCtrl) {
switch (e.key) {

Loading…
Cancel
Save