Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): don't auto focus link record dropdown input in mobile mode

Ramesh Maned51043930c25
diff --git a/packages/nc-gui/components/virtual-cell/components/LinkedItems.vue b/packages/nc-gui/components/virtual-cell/components/LinkedItems.vue
index 63d501e22c..7bcf11a3a6 100644
--- a/packages/nc-gui/components/virtual-cell/components/LinkedItems.vue
+++ b/packages/nc-gui/components/virtual-cell/components/LinkedItems.vue
@@ -299,6 +299,9 @@ const linkOrUnLink = (rowRef: Record<string, string>, id: string) => {
}
watch([filterQueryRef, isDataExist], () => {
+ // Don't focus input on open dropdown in mobile mode
+ if (isMobileMode.value) return
+
if (readOnly.value || isPublic.value ? isDataExist.value : true) {
filterQueryRef.value?.focus()
}
@@ -327,6 +330,9 @@ const linkedShortcuts = (e: KeyboardEvent) => {
onMounted(() => {
loadRelatedTableMeta()
window.addEventListener('keydown', linkedShortcuts)
+
+ // Don't focus input on open dropdown in mobile mode
+ if (isMobileMode.value) return
setTimeout(() => {
filterQueryRef.value?.focus()
}, 100)
diff --git a/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue b/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue
index 3c17224ed2..819d5e8367 100644
--- a/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue
+++ b/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue
@@ -207,6 +207,9 @@ watch(expandedFormDlg, () => {
})
watch(filterQueryRef, () => {
+ // Don't focus input on open dropdown in mobile mode
+ if (isMobileMode.value) return
+
filterQueryRef.value?.focus()
})
@@ -313,6 +316,9 @@ watch(childrenExcludedListPagination, () => {
onMounted(() => {
window.addEventListener('keydown', linkedShortcuts)
loadRelatedTableMeta()
+
+ // Don't focus input on open dropdown in mobile mode
+ if (isMobileMode.value) return
setTimeout(() => {
filterQueryRef.value?.focus()
}, 100)