Skip to content

Commit

Permalink
Merge pull request #65 from jean-1314/master
Browse files Browse the repository at this point in the history
Add aria-label attributes to slider control buttons
  • Loading branch information
shhdgit committed Sep 17, 2020
2 parents 2505e46 + 493f04a commit 0bc5a5e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
/>
</div>
<template v-if="controlBtn">
<button class="slider-btn slider-btn-left" @click.stop="prev">
<i class="slider-icon slider-icon-left" />
<button class="slider-btn slider-btn-left" :aria-label="prevBtnLabel" @click.stop="prev">
<i class="slider-icon slider-icon-left" aria-hidden="true"/>
</button>
<button class="slider-btn slider-btn-right" @click.stop="next">
<i class="slider-icon slider-icon-right" />
<button class="slider-btn slider-btn-right" :aria-label="nextBtnLabel" @click.stop="next">
<i class="slider-icon slider-icon-right" aria-hidden="true"/>
</button>
</template>
</div>
Expand Down Expand Up @@ -104,6 +104,14 @@ export default {
type: Function,
default: () => true,
},
prevBtnLabel: {
type: String,
default: 'Previous slide',
},
nextBtnLabel: {
type: String,
default: 'Next slide',
},
},
data() {
return {
Expand Down

0 comments on commit 0bc5a5e

Please sign in to comment.