Permalink
Browse files

fix(carousel): uncaught typeerror on empty slides. (#1401)

* Fix carousel error on empty slides.  

Add extra validation for slides Uncaught TypeError: Cannot set property 'tabIndex' of undefined in pause() function

* Fix lint error

* Optimize code

* Update carousel.js
  • Loading branch information...
bharathvaj1995 authored and tmorehouse committed Nov 24, 2017
1 parent 5daa0df commit a2ee9b6498d655e4bf92b261453ce4dcade0e499
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/components/carousel/carousel.js
@@ -286,8 +286,10 @@ export default {
if (this.isCycling) {
clearInterval(this.intervalId)
this.intervalId = null
// Make current slide focusable for screen readers
this.slides[this.index].tabIndex = 0
if (this.slides[this.index]) {
// Make current slide focusable for screen readers
this.slides[this.index].tabIndex = 0
}
}
},
// Start auto rotate slides

0 comments on commit a2ee9b6

Please sign in to comment.