fix(UI): BaseSelect keyboard navigation

This commit is contained in:
Giulio Ganci 2022-05-13 18:35:02 +02:00
parent 71b0736d0d
commit 7c45203636
1 changed files with 3 additions and 1 deletions

View File

@ -46,13 +46,14 @@
:key="opt.id"
:ref="(el) => optionRefs[index] = el"
:class="{
'select__item': true,
'select__group': opt.$type === 'group',
'select__option--highlight': opt.$type === 'option' && !opt.disabled && index === hightlightedIndex,
'select__option--selected': opt.$type === 'option' && isSelected(opt),
'select__option--disabled': opt.disabled
}"
@click.stop="select(opt)"
@mouseenter.self="hightlightedIndex = index"
@mousemove.self="hightlightedIndex = index"
>
<slot
name="option"
@ -70,6 +71,7 @@
<script>
import { defineComponent, computed, ref, watch, nextTick, onMounted, onUnmounted } from 'vue';
import { option } from 'yargs';
export default defineComponent({
name: 'BaseSelect',