Skip to content

Commit

Permalink
no results, no scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Apr 29, 2024
1 parent d349c1b commit d4de0d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ input.addEventListener("input", () => {
: `<div>${results.length.toLocaleString("en-US")} result${
results.length === 1 ? "" : "s"
}</div><ol>${renderResults(results)}</ol>`;
resultsContainer.querySelector(`.${activeClass}`).scrollIntoView({block: "nearest"});
resultsContainer.querySelector(`.${activeClass}`)?.scrollIntoView({block: "nearest"});
});

function renderResults(results) {
Expand Down

0 comments on commit d4de0d1

Please sign in to comment.