mirror of
https://github.com/glanceapp/glance.git
synced 2025-02-16 10:29:41 +01:00
Better autofocus, to make it work on mobile somehow
This commit is contained in:
parent
bacb607d90
commit
fc0b4ecdfb
@ -614,6 +614,10 @@ async function setupPage() {
|
||||
setupLazyImages();
|
||||
} finally {
|
||||
pageElement.classList.add("content-ready");
|
||||
const inputElement = document.getElementsByClassName("search-input")[0];
|
||||
if (inputElement.dataset.autofocus == 'autofocus'){
|
||||
inputElement.focus()
|
||||
}
|
||||
|
||||
for (let i = 0; i < contentReadyCallbacks.length; i++) {
|
||||
contentReadyCallbacks[i]();
|
||||
|
@ -16,7 +16,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<input class="search-input" type="text" placeholder="Type here to search…" autocomplete="off"{{ if .Autofocus }} autofocus{{ end }}>
|
||||
<input class="search-input" type="text" placeholder="Type here to search…" autocomplete="off" data-autofocus="{{ if .Autofocus }}autofocus{{ end }}">
|
||||
|
||||
<div class="search-bang"></div>
|
||||
<kbd class="hide-on-mobile" title="Press [S] to focus the search input">S</kbd>
|
||||
|
Loading…
Reference in New Issue
Block a user