From 520f8e74d36d84fe3d806c5915bfa7cd6a040a1c Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Thu, 28 Nov 2024 08:47:55 +0100 Subject: [PATCH] Automatically focus the input field --- .../add_work_package_child_form_component.html.erb | 2 +- .../work_package_relation_form_component.html.erb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/work_package_relations_tab/add_work_package_child_form_component.html.erb b/app/components/work_package_relations_tab/add_work_package_child_form_component.html.erb index affa7550c3ea..17142756557b 100644 --- a/app/components/work_package_relations_tab/add_work_package_child_form_component.html.erb +++ b/app/components/work_package_relations_tab/add_work_package_child_form_component.html.erb @@ -25,7 +25,7 @@ resource: 'work_packages', searchKey: 'subjectOrId', openDirectly: false, - focusDirectly: false, + focusDirectly: true, dropdownPosition: 'bottom', appendTo: "##{DIALOG_ID}", data: { test_selector: ID_FIELD_TEST_SELECTOR } diff --git a/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb b/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb index ea3d88f96afe..0a6f63688a42 100644 --- a/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb +++ b/app/components/work_package_relations_tab/work_package_relation_form_component.html.erb @@ -45,7 +45,7 @@ url:, relations: true, # Activates relations fetch mode in the autocomplete openDirectly: false, - focusDirectly: false, + focusDirectly: true, dropdownPosition: 'bottom', appendTo: "##{DIALOG_ID}", data: { test_selector: TO_ID_FIELD_TEST_SELECTOR} @@ -56,6 +56,7 @@ my_form.text_field( name: :description, label: Relation.human_attribute_name(:description), + autofocus: relation.persisted? ) end end