Skip to content

Commit 7182ef5

Browse files
author
Andrew Leach
committed
PR feedback
1 parent 4365fb9 commit 7182ef5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default class Combobox {
7979
this.input.addEventListener('input', this.inputHandler)
8080
;(this.input as HTMLElement).addEventListener('keydown', this.keyboardEventHandler)
8181
this.list.addEventListener('click', commitWithElement)
82-
this.indicateDefaultOption()
82+
this.resetSelection()
8383
}
8484

8585
stop(): void {
@@ -138,8 +138,9 @@ export default class Combobox {
138138

139139
clearSelection(): void {
140140
this.input.removeAttribute('aria-activedescendant')
141-
for (const el of this.list.querySelectorAll('[aria-selected="true"]')) {
141+
for (const el of this.list.querySelectorAll('[aria-selected="true"], [data-combobox-option-default="true"]')) {
142142
el.removeAttribute('aria-selected')
143+
el.removeAttribute('data-combobox-option-default')
143144
}
144145
}
145146

0 commit comments

Comments
 (0)