mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Rate): improve a11y when disabled or readonly (#9881)
This commit is contained in:
parent
a6df789488
commit
ec2ff59270
@ -15,6 +15,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -131,6 +133,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
|
@ -308,6 +308,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
|
@ -232,6 +232,8 @@ export default defineComponent({
|
||||
disabled: props.disabled,
|
||||
})}
|
||||
tabindex={props.disabled ? undefined : 0}
|
||||
aria-disabled={props.disabled}
|
||||
aria-readonly={props.readonly}
|
||||
onTouchstart={onTouchStart}
|
||||
onTouchmove={onTouchMove}
|
||||
>
|
||||
|
@ -5,6 +5,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -62,6 +64,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -119,6 +123,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -186,6 +192,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -247,6 +255,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -313,6 +323,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div>
|
||||
<div role="radiogroup"
|
||||
class="van-rate van-rate--disabled"
|
||||
aria-disabled="true"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -365,6 +377,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate van-rate--readonly"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="true"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -422,6 +436,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate van-rate--readonly"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="true"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
@ -483,6 +499,8 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
class="van-rate__item"
|
||||
|
@ -4,6 +4,8 @@ exports[`should render gutter when using gutter prop 1`] = `
|
||||
<div role="radiogroup"
|
||||
class="van-rate"
|
||||
tabindex="0"
|
||||
aria-disabled="false"
|
||||
aria-readonly="false"
|
||||
>
|
||||
<div role="radio"
|
||||
style="padding-right: 10px;"
|
||||
|
Loading…
x
Reference in New Issue
Block a user