mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
feat(Tabs): add aria-disabled for a11y (#9878)
This commit is contained in:
parent
e2a4f091ea
commit
b39784ab3d
@ -284,6 +284,7 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="tab"
|
||||
class="van-tab van-tab--disabled"
|
||||
aria-selected="false"
|
||||
aria-disabled="true"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
Tab 2
|
||||
|
@ -60,6 +60,7 @@ exports[`should allow to set name prop 1`] = `
|
||||
<div role="tab"
|
||||
class="van-tab van-tab--disabled"
|
||||
aria-selected="false"
|
||||
aria-disabled="true"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
title3
|
||||
@ -187,6 +188,7 @@ exports[`should switch tab after click the tab title 1`] = `
|
||||
<div role="tab"
|
||||
class="van-tab van-tab--disabled"
|
||||
aria-selected="false"
|
||||
aria-disabled="true"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
title3
|
||||
@ -247,6 +249,7 @@ exports[`should switch tab after click the tab title 2`] = `
|
||||
<div role="tab"
|
||||
class="van-tab van-tab--disabled"
|
||||
aria-selected="false"
|
||||
aria-disabled="true"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
title3
|
||||
@ -308,6 +311,7 @@ exports[`swipe switch tab after swiping tab content 1`] = `
|
||||
<div role="tab"
|
||||
class="van-tab van-tab--disabled"
|
||||
aria-selected="false"
|
||||
aria-disabled="true"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
title3
|
||||
@ -382,6 +386,7 @@ exports[`swipe switch tab after swiping tab content 2`] = `
|
||||
<div role="tab"
|
||||
class="van-tab van-tab--disabled"
|
||||
aria-selected="false"
|
||||
aria-disabled="true"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
title3
|
||||
@ -459,6 +464,7 @@ exports[`swipe switch tab after swiping tab content 3`] = `
|
||||
<div role="tab"
|
||||
class="van-tab van-tab--disabled"
|
||||
aria-selected="false"
|
||||
aria-disabled="true"
|
||||
>
|
||||
<span class="van-tab__text van-tab__text--ellipsis">
|
||||
title3
|
||||
|
@ -85,6 +85,7 @@ export default defineComponent({
|
||||
style={style.value}
|
||||
tabindex={props.disabled ? undefined : props.isActive ? 0 : -1}
|
||||
aria-selected={props.isActive}
|
||||
aria-disabled={props.disabled || undefined}
|
||||
>
|
||||
{renderText()}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user