Commit 711c6a32c9a3786ecac5194e6f036e935aa39bd5
1 parent
c15ea08c
Add keyboard control
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
src/components/switch/switch.vue
1 | 1 | <template> |
2 | - <span :class="wrapClasses" @click="toggle"> | |
2 | + <span | |
3 | + tabindex="0" | |
4 | + :class="wrapClasses" | |
5 | + @click="toggle" | |
6 | + @keydown.space="toggle" | |
7 | + > | |
3 | 8 | <input type="hidden" :name="name" :value="currentValue"> |
4 | 9 | <span :class="innerClasses"> |
5 | 10 | <slot name="open" v-if="currentValue === trueValue"></slot> | ... | ... |