From 5c085758d132d13c8d711dbbda38594c22b34c57 Mon Sep 17 00:00:00 2001 From: Pieter Lambrecht Date: Thu, 17 Mar 2022 21:33:37 +0100 Subject: [PATCH] #7839 Focus on Searchbar --- netbox/project-static/dist/netbox.js | Bin 375602 -> 375658 bytes netbox/project-static/dist/netbox.js.map | Bin 344930 -> 344957 bytes netbox/project-static/src/netbox.ts | 4 ++-- .../utilities/templates/search/searchbar.html | 7 ++++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index 45abd19e6209158d93fbe083fce3e1de985a9f5e..c1116d1dc118d0ea396060ed52ce49d6f42fb10a 100644 GIT binary patch delta 62 zcmdn=P3+Y-v4$4L7N!>F7M3ln{#zy&wuvd|l_aM7CFZ8;mE?yO6r>h8Cl;q_Xe!#; SDtY<^goY?>_uaz!lnns=(-yY? delta 25 hcmaF$O>EOQv4$4L7N!>F7M3ln{#&-UZ()7R1^}2+3hMv> diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index c7e20fe9ae4893f6bbbbd26ccb95f35b556214cb..a5ba2036c186a4ebe7276da460aef98eacfa468d 100644 GIT binary patch delta 55 zcmaFVCi=Hcw4sHug{g(Pg=GutA167-K%HPm$6%dgN5^EHKt~`q-O150+X*P@n&CG6 IzY}XR031dVW&i*H delta 28 jcmey{Ci('.content-container'); - if (contentContainer !== null) { - // Focus the content container for accessible navigation. + if (contentContainer !== null && document.activeElement.tagName.toUpperCase() !== 'INPUT') { + // Focus the content container for accessible navigation, unless an input item has focus contentContainer.focus(); } } diff --git a/netbox/utilities/templates/search/searchbar.html b/netbox/utilities/templates/search/searchbar.html index d71fd8e69..76ea603f8 100644 --- a/netbox/utilities/templates/search/searchbar.html +++ b/netbox/utilities/templates/search/searchbar.html @@ -5,9 +5,10 @@ aria-label="Search" placeholder="Search" class="form-control" - value="{{ request.GET.q }}" - /> - + value="" + {% if request.GET.q %}autofocus + onfocus="this.value = '{{ request.GET.q }}';" {% endif %} + /> All Objects