🐛 fix(search): restore highlighting functionality

Broke in #388.

- Rename local searchInput variable to inputValue
- Preserve global searchInput DOM element reference
This commit is contained in:
welpo 2024-09-24 19:09:35 +02:00
parent fc04ab4e40
commit 3100730305
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6
2 changed files with 4 additions and 4 deletions

View file

@ -2942,13 +2942,13 @@ window.onload = function () {
searchInput.addEventListener(
'input',
async function () {
const searchInput = this.value;
const searchTerm = searchInput.trim();
const inputValue = this.value;
const searchTerm = inputValue.trim();
const searchIndex = await searchIndexPromise;
results.innerHTML = '';
// Use the raw input so the "clear" button appears even if there's only spaces.
clearSearchButton.style.display = searchInput.length > 0 ? 'block' : 'none';
clearSearchButton.style.display = inputValue.length > 0 ? 'block' : 'none';
resultsContainer.style.display = searchTerm.length > 0 ? 'block' : 'none';
// Perform the search and store the results.

File diff suppressed because one or more lines are too long