From d4de0d13c2407e6bd4c94d6e99649bb1b42fbc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Tue, 12 Mar 2024 13:44:04 +0100 Subject: [PATCH] no results, no scroll --- src/client/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/search.js b/src/client/search.js index 60bd9111e..7e55663ca 100644 --- a/src/client/search.js +++ b/src/client/search.js @@ -44,7 +44,7 @@ input.addEventListener("input", () => { : `
${results.length.toLocaleString("en-US")} result${ results.length === 1 ? "" : "s" }
    ${renderResults(results)}
`; - resultsContainer.querySelector(`.${activeClass}`).scrollIntoView({block: "nearest"}); + resultsContainer.querySelector(`.${activeClass}`)?.scrollIntoView({block: "nearest"}); }); function renderResults(results) {