Skip to content

Commit a53b506

Browse files
authored
fix: scroll search into view on iOS-devices (#417)
Previously, the search field on iOS devices was only visible in the viewport once you started typing. Now, clicking the magnifying glass scrolls directly to the search field.
1 parent cce7aad commit a53b506

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

assets/js/search.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const initSearch = () => {
5656
search.classList.add("o-search--show");
5757
overlay.classList.add("overlay--show", "overlay--show-lv5");
5858
searchElement.focus();
59+
search.scrollIntoView({ behavior: "smooth", block: "start" });
5960
}
6061

6162
function showSearchOnStartPage() {

0 commit comments

Comments
 (0)