Browse Source

fix(nc-gui): keybindings

pull/6820/head
DarkPhoenix2704 1 year ago
parent
commit
fee1fb12c6
  1. 2
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  2. 24
      packages/nc-gui/components/smartsheet/details/Fields.vue

2
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -230,7 +230,7 @@ if (props.fromTableExplorer) {
<input
ref="antInput"
v-model="formState.title"
class="flex flex-grow text-lg font-bold outline-none bg-inherit"
class="flex flex-grow nc-fields-input text-lg font-bold outline-none bg-inherit"
:contenteditable="true"
/>
</div>

24
packages/nc-gui/components/smartsheet/details/Fields.vue

@ -606,12 +606,31 @@ onKeyDown('ArrowUp', () => {
})
onKeyDown('Delete', () => {
if (document.activeElement?.tagName === 'INPUT') return
const isDeletedField = fieldStatus(activeField.value) === 'delete'
if (!isDeletedField && activeField.value) {
onFieldDelete(activeField.value)
}
})
onKeyDown('Backspace', () => {
if (document.activeElement?.tagName === 'INPUT') return
const isDeletedField = fieldStatus(activeField.value) === 'delete'
if (!isDeletedField && activeField.value) {
onFieldDelete(activeField.value)
}
})
onKeyDown('ArrowRight', () => {
if (document.activeElement?.tagName === 'INPUT') return
if (activeField.value) {
const input = document.querySelector('.nc-fields-input')
if (input) {
input.focus()
}
}
})
const keys = useMagicKeys()
whenever(keys.altleft_c, () => {
@ -619,6 +638,11 @@ whenever(keys.altleft_c, () => {
if (openedViewsTab.value === 'field') addField()
})
whenever(keys.option_c, () => {
if (!meta.value?.id) return
if (openedViewsTab.value === 'field') addField()
})
whenever(keys.meta_s, () => {
if (!meta.value?.id) return
if (openedViewsTab.value === 'field') saveChanges()

Loading…
Cancel
Save