@@ -256,6 +256,7 @@ const scrollSnaps = ref<number[]>([])
256256function onInit(api : EmblaCarouselType ) {
257257 scrollSnaps .value = api ?.scrollSnapList () || []
258258}
259+
259260function onSelect(api : EmblaCarouselType ) {
260261 canScrollNext .value = api ?.canScrollNext () || false
261262 canScrollPrev .value = api ?.canScrollPrev () || false
@@ -300,8 +301,7 @@ defineExpose({
300301 <div
301302 v-for =" (item, index) in items"
302303 :key =" index"
303- role =" group"
304- aria-roledescription =" slide"
304+ v-bind =" dots ? { role: 'tabpanel' } : { 'role': 'group', 'aria-roledescription': 'slide' }"
305305 :class =" ui.item({ class: [props.ui?.item, isCarouselItem(item) && item.ui?.item, isCarouselItem(item) && item.class] })"
306306 >
307307 <slot :item =" item" :index =" index" />
@@ -333,14 +333,15 @@ defineExpose({
333333 />
334334 </div >
335335
336- <div v-if =" dots" :class =" ui.dots({ class: props.ui?.dots })" >
336+ <div v-if =" dots" role = " tablist " :aria-label = " t('carousel.dots') " :class =" ui.dots({ class: props.ui?.dots })" >
337337 <template v-for =" (_ , index ) in scrollSnaps " :key =" index " >
338338 <button
339339 type =" button"
340+ role =" tab"
340341 :aria-label =" t('carousel.goto', { slide: index + 1 })"
342+ :aria-selected =" selectedIndex === index"
341343 :class =" ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
342344 :data-state =" selectedIndex === index ? 'active' : undefined"
343- :aria-current =" selectedIndex === index ? true : undefined"
344345 @click =" scrollTo(index)"
345346 />
346347 </template >
0 commit comments