Skip to content

Commit

Permalink
fix(Carousel): add tab-based ARIA roles (#1516)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmggithub committed Mar 14, 2024
1 parent cee3e12 commit e736eca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/components/elements/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
v-for="(item, index) in items"
:key="index"
:class="ui.item"
:role="indicators ? 'tabpanel' : null"
>
<slot :item="item" :index="index" />
</div>
Expand Down Expand Up @@ -34,11 +35,13 @@
</slot>
</div>
<div v-if="indicators" :class="ui.indicators.wrapper">
<div v-if="indicators" role="tablist" :class="ui.indicators.wrapper">
<template v-for="page in pages" :key="page">
<slot name="indicator" :on-click="onClick" :active="page === currentPage" :page="page">
<button
type="button"
role="tab"
:aria-selected="page === currentPage"
:class="[
ui.indicators.base,
page === currentPage ? ui.indicators.active : ui.indicators.inactive
Expand Down

0 comments on commit e736eca

Please sign in to comment.