2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

Merge pull request #607 from beattyml1/master

Added combobox, listbox, and option roles, Closes #606
This commit is contained in:
Jeff Sagal
2018-08-02 21:20:47 -07:00
committed by GitHub
+4 -2
View File
@@ -355,6 +355,8 @@
:tabindex="tabindex" :tabindex="tabindex"
:readonly="!searchable" :readonly="!searchable"
:id="inputId" :id="inputId"
role="combobox"
:aria-expanded="dropdownOpen"
aria-label="Search for option" aria-label="Search for option"
> >
@@ -377,8 +379,8 @@
</div> </div>
<transition :name="transition"> <transition :name="transition">
<ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }"> <ul ref="dropdownMenu" v-if="dropdownOpen" class="dropdown-menu" :style="{ 'max-height': maxHeight }" role="listbox">
<li v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index"> <li role="option" v-for="(option, index) in filteredOptions" v-bind:key="index" :class="{ active: isOptionSelected(option), highlight: index === typeAheadPointer }" @mouseover="typeAheadPointer = index">
<a @mousedown.prevent="select(option)"> <a @mousedown.prevent="select(option)">
<slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}"> <slot name="option" v-bind="(typeof option === 'object')?option:{[label]: option}">
{{ getOptionLabel(option) }} {{ getOptionLabel(option) }}