mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Focus search input when opened.
This commit is contained in:
@@ -109,6 +109,10 @@ searchTarget is the ID of the core-list element to search the elements of.
|
||||
document.getElementById(host.searchTarget).scrollToItem(host.results[host.currentResult]);
|
||||
},
|
||||
|
||||
focusInput: function() {
|
||||
this.shadowRoot.getElementById('search').focus();
|
||||
},
|
||||
|
||||
search: function() {
|
||||
this.shadowRoot.getElementById('search').dispatchEvent(new Event('input'));
|
||||
},
|
||||
|
||||
@@ -648,6 +648,7 @@ function onContentRefresh(evt) {
|
||||
}
|
||||
function onSearchOpen(evt) {
|
||||
document.getElementById('mainToolbar').classList.add('search');
|
||||
document.getElementById('searchBar').focusInput();
|
||||
}
|
||||
function onSearchClose(evt) {
|
||||
document.getElementById('mainToolbar').classList.remove('search');
|
||||
|
||||
Reference in New Issue
Block a user