Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions static/search.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ function initializeSearch(root) {
document.body.classList.toggle("is-search-open", open);

if (open) {
// Keep focus in the tap handler so mobile browsers open the keyboard.
input.focus();
loadEngine().catch(() => {});
requestAnimationFrame(() => input.focus());
} else {
resetSearch();
if (returnFocus) {
Expand Down Expand Up @@ -244,7 +245,8 @@ function initializeSearch(root) {
}
});

document.addEventListener("pointerdown", (event) => {
// A click fires after a touch gesture, so scrolling does not dismiss results.
document.addEventListener("click", (event) => {
if (
!panel.hidden &&
!root.contains(event.target) &&
Expand Down