diff --git a/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue b/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
index a7ba0c2443..f4351b3df6 100644
--- a/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
+++ b/packages/nc-gui/components/virtual-cell/components/ListChildItems.vue
@@ -1,22 +1,20 @@
@@ -271,6 +293,8 @@ watch([filterQueryRef, isDataExist], () => {
:is-linked="childrenList?.list ? isChildrenListLinked[Number.parseInt(id)] : true"
:is-loading="isChildrenListLoading[Number.parseInt(id)]"
@expand="onClick(refRow)"
+ @keydown.space.prevent="linkOrUnLink(refRow, id)"
+ @keydown.enter.prevent="() => onClick(refRow, id)"
@click="linkOrUnLink(refRow, id)"
/>
diff --git a/packages/nc-gui/components/virtual-cell/components/ListItem.vue b/packages/nc-gui/components/virtual-cell/components/ListItem.vue
index 6cb49e0848..79e16aed3f 100644
--- a/packages/nc-gui/components/virtual-cell/components/ListItem.vue
+++ b/packages/nc-gui/components/virtual-cell/components/ListItem.vue
@@ -89,7 +89,8 @@ const displayValue = computed(() => {
-import { RelationTypes, isLinksOrLTAR, isSystemColumn } from 'nocodb-sdk'
import type { ColumnType, LinkToAnotherRecordType } from 'nocodb-sdk'
+import { RelationTypes, isLinksOrLTAR, isSystemColumn } from 'nocodb-sdk'
import InboxIcon from '~icons/nc-icons/inbox'
import {
ColumnInj,
@@ -8,7 +8,6 @@ import {
SaveRowInj,
computed,
inject,
- onKeyStroke,
ref,
useLTARStoreOrThrow,
useSmartsheetRowStoreOrThrow,
@@ -173,10 +172,6 @@ watch(filterQueryRef, () => {
filterQueryRef.value?.focus()
})
-onKeyStroke('Escape', () => {
- vModel.value = false
-})
-
const onClick = (refRow: any, id: string) => {
if (isSharedBase.value) return
if (isChildrenExcludedListLinked.value[Number.parseInt(id)]) {
@@ -221,6 +216,34 @@ const onCreatedRecord = (record: any) => {
message.success(msgVNode)
}
+
+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()
+ } catch (e) {}
+ }
+}
+
+onMounted(() => {
+ window.addEventListener('keydown', linkedShortcuts)
+})
+
+onUnmounted(() => {
+ window.removeEventListener('keydown', linkedShortcuts)
+})
@@ -328,6 +351,8 @@ const onCreatedRecord = (record: any) => {
expandedFormDlg = true
}
"
+ @keydown.space.prevent="() => onClick(refRow, id)"
+ @keydown.enter.prevent="() => onClick(refRow, id)"
@click="() => onClick(refRow, id)"
/>