Skip to content

Commit af4e55c

Browse files
authored
Merge pull request sagalbot#607 from beattyml1/master
Added combobox, listbox, and option roles, Closes sagalbot#606
2 parents a0c8efe + 7e3f455 commit af4e55c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/Select.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@
355355
:tabindex="tabindex"
356356
:readonly="!searchable"
357357
:id="inputId"
358+
role="combobox"
359+
:aria-expanded="dropdownOpen"
358360
aria-label="Search for option"
359361
>
360362

@@ -377,8 +379,8 @@
377379
</div>
378380

379381
<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">
382+
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" role="listbox">
383+
<li role="option" v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
382384
<a @mousedown.prevent="select(option)">
383385
<slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}">
384386
{{ getOptionLabel(option) }}

0 commit comments

Comments
 (0)