Skip to content

Commit

Permalink
activedescendant must match active item
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Oct 11, 2024
1 parent 5bb4d9a commit 656b32f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,9 @@ class Autocomplete {
return;
}
this.removeSelection();
newChild.querySelector("a").classList.add(...this._activeClasses());
const a = newChild.querySelector("a");
a.classList.add(...this._activeClasses());
this._searchInput.setAttribute("aria-activedescendant", a.id);
});
// Prevent searchInput losing focus and close the menu
newChildLink.addEventListener("mousedown", (event) => {
Expand Down

0 comments on commit 656b32f

Please sign in to comment.