We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce22bbc commit 51f159bCopy full SHA for 51f159b
1 file changed
src/index.ts
@@ -126,11 +126,17 @@ export default class Combobox {
126
el.removeAttribute('data-combobox-option-default')
127
128
if (target === el) {
129
+ if (!target.id) {
130
+ target.id = `${this.list.id}-selected`
131
+ }
132
this.input.setAttribute('aria-activedescendant', target.id)
133
target.setAttribute('aria-selected', 'true')
134
fireSelectEvent(target)
135
target.scrollIntoView(this.scrollIntoViewOptions)
136
} else {
137
+ if (el.id === `${this.list.id}-selected`) {
138
+ el.removeAttribute('id');
139
140
el.removeAttribute('aria-selected')
141
}
142
0 commit comments