feat(Switch): add tabindex for a11y (#9887)
This commit is contained in:
@@ -117,6 +117,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch"
|
class="van-switch"
|
||||||
style="font-size: 24px;"
|
style="font-size: 24px;"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="false"
|
aria-checked="false"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ exports[`should render AddressEdit with props correctly 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch van-switch--on"
|
class="van-switch van-switch--on"
|
||||||
style="font-size: 24px;"
|
style="font-size: 24px;"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch"
|
class="van-switch"
|
||||||
style="font-size: 24px;"
|
style="font-size: 24px;"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="false"
|
aria-checked="false"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch"
|
class="van-switch"
|
||||||
style="font-size: 20px;"
|
style="font-size: 20px;"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="false"
|
aria-checked="false"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch"
|
class="van-switch"
|
||||||
style="font-size: 24px;"
|
style="font-size: 24px;"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="false"
|
aria-checked="false"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export default defineComponent({
|
|||||||
disabled,
|
disabled,
|
||||||
})}
|
})}
|
||||||
style={style}
|
style={style}
|
||||||
|
tabindex={disabled ? undefined : 0}
|
||||||
aria-checked={checked}
|
aria-checked={checked}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div>
|
<div>
|
||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch van-switch--on"
|
class="van-switch van-switch--on"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
@@ -22,6 +23,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div>
|
<div>
|
||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch van-switch--on van-switch--loading"
|
class="van-switch van-switch--on van-switch--loading"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
@@ -46,6 +48,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch van-switch--on"
|
class="van-switch van-switch--on"
|
||||||
style="font-size: 24px;"
|
style="font-size: 24px;"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
@@ -56,6 +59,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch van-switch--on"
|
class="van-switch van-switch--on"
|
||||||
style="background-color: rgb(238, 10, 36);"
|
style="background-color: rgb(238, 10, 36);"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
@@ -65,6 +69,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div>
|
<div>
|
||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch van-switch--on"
|
class="van-switch van-switch--on"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
@@ -81,6 +86,7 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
<div role="switch"
|
<div role="switch"
|
||||||
class="van-switch van-switch--on"
|
class="van-switch van-switch--on"
|
||||||
style="font-size: 24px;"
|
style="font-size: 24px;"
|
||||||
|
tabindex="0"
|
||||||
aria-checked="true"
|
aria-checked="true"
|
||||||
>
|
>
|
||||||
<div class="van-switch__node">
|
<div class="van-switch__node">
|
||||||
|
|||||||
Reference in New Issue
Block a user