Bug 33152: Add focus to search field

This patch adds focus to the search field for a new SQL report from
mana.

Test plan:
1) Navigate to Reports > Create from SQL
2) Click on the new report dropdown and select "New SQL from Mana"
3) Observe that there is no focus on the input and the user needs to
   click to start typing
4) Apply patch
5) Repeat steps 1-2
6) There should now be focus on the input and typing can be started
   immediately

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-03-08 12:04:57 +00:00 committed by Tomas Cohen Arazi
parent b70ce9dcad
commit 6f6f7e15f8

View file

@ -2187,6 +2187,10 @@
mana_use( $(this).data("report_id") );
});
$("#mana_search_result").on("shown.bs.modal", function(){
$("#mana_search_field").focus();
});
$("#mana_search_result").on("hide.bs.modal", function(){
$("#mana_result_content").html("");
$("#mana_search_field").val("");