search key nav fixes 2
All checks were successful
Build Org Website / build (push) Successful in 44s
All checks were successful
Build Org Website / build (push) Successful in 44s
This commit is contained in:
@@ -195,6 +195,11 @@ function isSearchOpen() {
|
||||
return modal.classList.contains("is-open");
|
||||
}
|
||||
|
||||
function focusPaneInput() {
|
||||
paneInput.focus({ preventScroll: true });
|
||||
paneInput.setSelectionRange(paneInput.value.length, paneInput.value.length);
|
||||
}
|
||||
|
||||
function openSearchPane(initialValue = "") {
|
||||
const value = initialValue || searchInput?.value || paneInput?.value || "";
|
||||
|
||||
@@ -206,10 +211,8 @@ function openSearchPane(initialValue = "") {
|
||||
setHeaderSearchValue(value);
|
||||
renderResults(value);
|
||||
|
||||
window.setTimeout(() => {
|
||||
paneInput.focus();
|
||||
paneInput.setSelectionRange(paneInput.value.length, paneInput.value.length);
|
||||
}, 0);
|
||||
focusPaneInput();
|
||||
window.requestAnimationFrame(focusPaneInput);
|
||||
}
|
||||
|
||||
function closeSearchPane() {
|
||||
|
||||
Reference in New Issue
Block a user