1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-02-19 21:20:40 +01:00

fix(UI): BaseSelect keyboard navigation

This commit is contained in:
Giulio Ganci 2022-05-13 18:35:02 +02:00
parent 71b0736d0d
commit 7c45203636

View File

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