File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 9191 v-append-to-body
9292 class =" vs__dropdown-menu"
9393 role =" listbox"
94+ :aria-multiselectable =" multiple"
9495 tabindex =" -1"
9596 @mousedown.prevent =" onMousedown"
9697 @mouseup =" onMouseUp"
109110 'vs__dropdown-option--highlight': index === typeAheadPointer,
110111 'vs__dropdown-option--disabled': !selectable(option),
111112 }"
112- :aria-selected =" index === typeAheadPointer ? true : null "
113+ :aria-selected =" optionAriaSelected(option, index) "
113114 @mouseover =" selectable(option) ? (typeAheadPointer = index) : null"
114115 @click.prevent.stop =" selectable(option) ? select(option) : null"
115116 >
@@ -1212,6 +1213,24 @@ export default {
12121213 )
12131214 },
12141215
1216+ /**
1217+ * Determine the `aria-selected` value
1218+ * of an option
1219+ *
1220+ * @param {Object|String} option
1221+ * @param {Number} index
1222+ * @return {null|boolean}
1223+ */
1224+ optionAriaSelected (option , index ) {
1225+ if (! this .selectable (option)) {
1226+ return null
1227+ }
1228+ if (this .multiple ) {
1229+ return this .isOptionSelected (option)
1230+ }
1231+ return index === this .typeAheadPointer ? true : null
1232+ },
1233+
12151234 /**
12161235 * Ensures that options are always
12171236 * passed as objects to scoped slots.
You can’t perform that action at this time.
0 commit comments