{
const searchInput = document.querySelector('#nav-search');
if (searchInput) {
searchInput.focus();
// iOS Safari shifts the visual viewport when the virtual keyboard appears.
// Searchanise reads getBoundingClientRect() to position its dropdown, so
// we must wait for the keyboard animation and layout to settle before
// triggering it. focus() fires immediately so the keyboard starts rising;
// the click (which signals Searchanise to render and position its widget)
// is deferred. A resize event tells Searchanise to recompute coordinates.
setTimeout(() => {
window.dispatchEvent(new Event('resize'));
searchInput.click();
}, 120);
}
});
}
}
"
class="fixed w-full h-screen flex flex-col inset-0 bg-black/[0.65] z-20"
>