Browse Source

fix(nc-gui): add arrow shortcuts

pull/7624/head
DarkPhoenix2704 5 months ago
parent
commit
3ff5497fc4
  1. 10
      packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
  2. 10
      packages/nc-gui/components/virtual-cell/components/ListItems.vue

10
packages/nc-gui/components/virtual-cell/components/ListChildItems.vue

@ -179,6 +179,16 @@ watch([filterQueryRef, isDataExist], () => {
const linkedShortcuts = (e: KeyboardEvent) => {
if (e.key === 'Escape') {
vModel.value = false
} else if (e.key === 'ArrowDown') {
e.preventDefault()
try {
e.target?.nextElementSibling?.focus()
} catch (e) {}
} else if (e.key === 'ArrowUp') {
e.preventDefault()
try {
e.target?.previousElementSibling?.focus()
} catch (e) {}
} else if (e.key !== 'Tab' && e.key !== 'Shift' && e.key !== 'Enter' && e.key !== ' ') {
try {
filterQueryRef.value?.focus()

10
packages/nc-gui/components/virtual-cell/components/ListItems.vue

@ -220,6 +220,16 @@ const onCreatedRecord = (record: any) => {
const linkedShortcuts = (e: KeyboardEvent) => {
if (e.key === 'Escape') {
vModel.value = false
} else if (e.key === 'ArrowDown') {
e.preventDefault()
try {
e.target?.nextElementSibling?.focus()
} catch (e) {}
} else if (e.key === 'ArrowUp') {
e.preventDefault()
try {
e.target?.previousElementSibling?.focus()
} catch (e) {}
} else if (e.key !== 'Tab' && e.key !== 'Shift' && e.key !== 'Enter' && e.key !== ' ') {
try {
filterQueryRef.value?.focus()

Loading…
Cancel
Save