mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 04:58:16 -06:00
#7839 Focus on Searchbar
This commit is contained in:
parent
d53d348da4
commit
5c085758d1
BIN
netbox/project-static/dist/netbox.js
vendored
BIN
netbox/project-static/dist/netbox.js
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -38,8 +38,8 @@ function initDocument(): void {
|
||||
|
||||
function initWindow(): void {
|
||||
const contentContainer = document.querySelector<HTMLElement>('.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();
|
||||
}
|
||||
}
|
||||
|
@ -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 %}
|
||||
/>
|
||||
<input name="obj_type" hidden type="text" class="search-obj-type" />
|
||||
|
||||
<span class="input-group-text search-obj-selected">All Objects</span>
|
||||
|
Loading…
Reference in New Issue
Block a user