107107 isOptionDeselectable(option) && index === typeAheadPointer,
108108 'vs__dropdown-option--selected': isOptionSelected(option),
109109 'vs__dropdown-option--highlight': index === typeAheadPointer,
110+ 'vs__dropdown-option--kb-focus':
111+ isKeyboardNavigation && index === typeAheadPointer,
110112 'vs__dropdown-option--disabled': !selectable(option),
111113 }"
112114 :aria-selected =" index === typeAheadPointer ? true : null"
113- @mouseover =" selectable (option) ? (typeAheadPointer = index) : null "
115+ @mouseover =" onMouseOver (option, index)"
114116 @click.prevent.stop =" selectable(option) ? select(option) : null"
115117 >
116118 <slot name =" option" v-bind =" normalizeOptionForSlot(option)" >
@@ -675,6 +677,7 @@ export default {
675677 search: ' ' ,
676678 open: false ,
677679 isComposing: false ,
680+ isKeyboardNavigation: false ,
678681 pushedTags: [],
679682 // eslint-disable-next-line vue/no-reserved-keys
680683 _value: [], // Internal value managed by Vue Select if no `value` prop is passed
@@ -1309,6 +1312,20 @@ export default {
13091312 this .mousedown = false
13101313 },
13111314
1315+ /**
1316+ * Event-Handler for option mouseover
1317+ * @param {Object|String} option
1318+ * @param {Number} index
1319+ * @return {void}
1320+ */
1321+ onMouseOver (option , index ) {
1322+ this .isKeyboardNavigation = false
1323+ if (! this .selectable (option)) {
1324+ return
1325+ }
1326+ this .typeAheadPointer = index
1327+ },
1328+
13121329 /**
13131330 * Search <input> KeyBoardEvent handler.
13141331 * @param {KeyboardEvent} e
@@ -1330,6 +1347,7 @@ export default {
13301347 // up.prevent
13311348 38 : (e ) => {
13321349 e .preventDefault ()
1350+ this .isKeyboardNavigation = true
13331351 if (! this .open ) {
13341352 this .open = true
13351353 return
@@ -1339,6 +1357,7 @@ export default {
13391357 // down.prevent
13401358 40 : (e ) => {
13411359 e .preventDefault ()
1360+ this .isKeyboardNavigation = true
13421361 if (! this .open ) {
13431362 this .open = true
13441363 return
0 commit comments