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 pi0 committed Nov 24, 2017
1 parent 029e4d0 commit cadae7928c40e444d785b7bc317024473d700748
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 cadae79

Please sign in to comment.