From 5d0d51f2c3bd8211e987890b067e7a345f113afb Mon Sep 17 00:00:00 2001 From: newtextdoc1111 Date: Thu, 8 May 2025 22:20:06 +0900 Subject: [PATCH] fix: highlightItem calls to no argument --- web/js/autocomplete.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/js/autocomplete.js b/web/js/autocomplete.js index daef849..1ac21af 100644 --- a/web/js/autocomplete.js +++ b/web/js/autocomplete.js @@ -73,7 +73,7 @@ class AutocompleteUI { } else if (this.selectedIndex >= this.candidates.length) { this.selectedIndex = 0; // Wrap around to top } - this.#highlightItem(this.selectedIndex); + this.#highlightItem(); } /** Selects the currently highlighted item */ @@ -101,7 +101,7 @@ class AutocompleteUI { this.element.style.display = 'block'; // Make it visible // Highlight the first item - this.#highlightItem(this.selectedIndex); + this.#highlightItem(); } /** @@ -295,6 +295,7 @@ class AutocompleteUI { #highlightItem() { const tbody = this.element.querySelector('tbody'); if (!tbody) return; + const items = tbody.children; // Get rows (tr) from tbody for (let i = 0; i < items.length; i++) { if (i === this.selectedIndex) {