From d44c2bb1a9763802593660f1077fc6d387f66973 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sat, 15 Apr 2023 11:23:59 +0300 Subject: [PATCH] removed implicit autofocus as it is causing keyboard navigation issues --- .../records/RecordUpsertPanel.svelte | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/ui/src/components/records/RecordUpsertPanel.svelte b/ui/src/components/records/RecordUpsertPanel.svelte index 778ef5f4..3300b569 100644 --- a/ui/src/components/records/RecordUpsertPanel.svelte +++ b/ui/src/components/records/RecordUpsertPanel.svelte @@ -63,13 +63,11 @@ activeTab = TAB_FORM; - recordPanel?.show(); - - autofocusFirstInput(); + return recordPanel?.show(); } export function hide() { - recordPanel?.hide(); + return recordPanel?.hide(); } async function load(model) { @@ -262,23 +260,6 @@ initialFormHash = ""; } - - async function autofocusFirstInput() { - await tick(); - - if (!isNew) { - return; - } - - // autofocus the first available form element if no explicit autofocus is found - if (!recordForm.querySelector("[autofocus]")) { - recordForm - ?.querySelector( - ".form-field:not(.noautofocus) input, .form-field:not(.noautofocus) textarea, .form-field:not(.noautofocus) select" - ) - ?.focus(); - } - }