Skip to content

Commit

Permalink
fix(carousel): remove un-needed aria- atribute on slides (#1448)
Browse files Browse the repository at this point in the history
* fix(carousel): remove un-needed `aria-` atribute on slides

* Update carousel.js

* update carousel test code

* ESLint
  • Loading branch information
tmorehouse committed Dec 11, 2017
1 parent a9bddbd commit 260919f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/carousel/carousel.js
Expand Up @@ -321,7 +321,6 @@ export default {
const index = Math.max(0, Math.min(Math.floor(this.index), numSlides - 1))
this.slides.forEach((slide, idx) => {
const n = idx + 1
const id = this.safeId(`__BV_indicator_${n}_`)
if (idx === index) {
addClass(slide, 'active')
} else {
Expand All @@ -331,9 +330,6 @@ export default {
setAttr(slide, 'aria-posinset', String(n))
setAttr(slide, 'aria-setsize', String(numSlides))
slide.tabIndex = -1
if (id) {
setAttr(slide, 'aria-controlledby', id)
}
})
// Set slide as active
this.setSlide(index)
Expand Down Expand Up @@ -390,6 +386,7 @@ export default {
addClass(nextSlide, direction.dirClass)
// Transition End handler
let called = false
/* istanbul ignore next: dificult to test */
const onceTransEnd = (evt) => {
if (called) {
return
Expand Down Expand Up @@ -453,6 +450,7 @@ export default {
attributeFilter: [ 'id' ]
})
},
/* istanbul ignore next: dificult to test */
beforeDestroy () {
clearInterval(this.intervalId)
clearTimeout(this._animationTimeout)
Expand Down
5 changes: 5 additions & 0 deletions src/components/carousel/fixtures/carousel.js
Expand Up @@ -4,6 +4,11 @@ window.app = new Vue({
slide: 0,
sliding: null
},
mounted () {
this.$nextTick(() => {
this.slide = 2
})
},
methods: {
blankImg (x, y) {
// Return a blank SVG image with specified width and height
Expand Down

0 comments on commit 260919f

Please sign in to comment.