Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
anleac committed Feb 26, 2024
1 parent 4365fb9 commit 7182ef5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class Combobox {
this.input.addEventListener('input', this.inputHandler)
;(this.input as HTMLElement).addEventListener('keydown', this.keyboardEventHandler)
this.list.addEventListener('click', commitWithElement)
this.indicateDefaultOption()
this.resetSelection()
}

stop(): void {
Expand Down Expand Up @@ -138,8 +138,9 @@ export default class Combobox {

clearSelection(): void {
this.input.removeAttribute('aria-activedescendant')
for (const el of this.list.querySelectorAll('[aria-selected="true"]')) {
for (const el of this.list.querySelectorAll('[aria-selected="true"], [data-combobox-option-default="true"]')) {
el.removeAttribute('aria-selected')
el.removeAttribute('data-combobox-option-default')
}
}

Expand Down

0 comments on commit 7182ef5

Please sign in to comment.