From 7182ef587de85db41fc1213579ff63f8d4eab6a2 Mon Sep 17 00:00:00 2001 From: Andrew Leach Date: Mon, 26 Feb 2024 11:14:44 +0000 Subject: [PATCH] PR feedback --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index df48fc6..9c85298 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 { @@ -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') } }