File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ function onChange(value: any) {
118118
119119<template >
120120 <SliderRoot
121- v-bind =" { ... rootProps , ... ariaAttrs } "
121+ v-bind =" rootProps "
122122 :id =" id "
123123 v-model =" sliderValue "
124124 :name =" name "
@@ -140,9 +140,9 @@ function onChange(value: any) {
140140 disable-closing-trigger
141141 v-bind =" (typeof props .tooltip === ' object' ? props .tooltip : {}) "
142142 >
143- <SliderThumb data-slot="thumb" :class =" ui .thumb ({ class: props .ui ?.thumb })" :aria-label =" thumbs === 1 ? ' Thumb' : ` Thumb ${thumb } of ${thumbs } ` " />
143+ <SliderThumb data-slot="thumb" :class =" ui .thumb ({ class: props .ui ?.thumb })" :aria-label =" thumbs === 1 ? ' Thumb' : ` Thumb ${thumb } of ${thumbs } ` " v-bind = " ariaAttrs " />
144144 </UTooltip >
145- <SliderThumb v-else data-slot="thumb" :class =" ui .thumb ({ class: props .ui ?.thumb })" :aria-label =" thumbs === 1 ? ' Thumb' : ` Thumb ${thumb } of ${thumbs } ` " />
145+ <SliderThumb v-else data-slot="thumb" :class =" ui .thumb ({ class: props .ui ?.thumb })" :aria-label =" thumbs === 1 ? ' Thumb' : ` Thumb ${thumb } of ${thumbs } ` " v-bind = " ariaAttrs " />
146146 </template >
147147 </SliderRoot >
148148</template >
Original file line number Diff line number Diff line change @@ -133,6 +133,20 @@ describe('FormField', () => {
133133 } )
134134 }
135135
136+ if ( name === 'Slider' ) {
137+ test ( 'binds aria attributes on the thumb' , async ( ) => {
138+ const wrapper = await renderFormField ( {
139+ props : { error : 'Error' } ,
140+ inputComponent
141+ } )
142+
143+ const invalid = wrapper . findAll ( '[aria-invalid="true"]' )
144+ expect ( invalid ) . toHaveLength ( 1 )
145+ expect ( invalid [ 0 ] ! . attributes ( 'role' ) ) . toBe ( 'slider' )
146+ expect ( invalid [ 0 ] ! . attributes ( 'aria-describedby' ) ) . toBe ( 'v-0-0-error' )
147+ } )
148+ }
149+
136150 test ( 'binds hints with aria-describedby' , async ( ) => {
137151 const wrapper = await renderFormField ( {
138152 props : { hint : 'somehint' } ,
You can’t perform that action at this time.
0 commit comments