Skip to content

Commit d00b567

Browse files
committed
Added the combobox, listbox, and option roles to the input, ul, and li items respectively per W3C spec, Closes sagalbot#606
1 parent a0c8efe commit d00b567

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/Select.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@
355355
:tabindex="tabindex"
356356
:readonly="!searchable"
357357
:id="inputId"
358+
role="combobox"
358359
aria-label="Search for option"
359360
>
360361

@@ -377,8 +378,8 @@
377378
</div>
378379

379380
<transition :name="transition">
380-
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }">
381-
<li v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
381+
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" role="listbox">
382+
<li role="option" v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
382383
<a @mousedown.prevent="select(option)">
383384
<slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}">
384385
{{ getOptionLabel(option) }}

0 commit comments

Comments
 (0)