forked from opentiny/tiny-vue
fix(Switch): [Switch] add keydown support and improth the accessibility (#1428)
This commit is contained in:
parent
990c9fb816
commit
e32c0227cd
|
@ -29,7 +29,14 @@
|
|||
position: relative;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
transition: all 0.2s ease-in-out;
|
||||
transition:
|
||||
border 0.2s ease-in-out,
|
||||
background-color 0.2s ease-in-out;
|
||||
|
||||
&:focus-visible {
|
||||
outline: 2px solid var(--ti-switch-on-bg-color);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
& &-inner {
|
||||
color: var(--ti-switch-text-color);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
:tabindex="tabindex"
|
||||
@click="toggle"
|
||||
@keydown.space="toggle"
|
||||
@keydown.enter="toggle"
|
||||
>
|
||||
<span :class="state.innerClasses">
|
||||
<div v-if="!mini && state.showText">
|
||||
|
|
Loading…
Reference in New Issue