I encountered cloneNode error while using bulma-carousel with infinite option true.
Uncaught TypeError: Cannot read property 'cloneNode' of undefined
As mentioned in the issue https://github.com/Wikiki/bulma-carousel/issues/89, the error occurs when i set infinite: true and slidesToShow value is greater or equal to the length of the .carousel-item elements because the index goes to negative.
WHAT
Fix the index calculation to get always get a positive index (within the length).
WHY
I encountered
cloneNode
error while using bulma-carousel withinfinite
option true.As mentioned in the issue https://github.com/Wikiki/bulma-carousel/issues/89, the error occurs when i set
infinite: true
andslidesToShow
value is greater or equal to the length of the.carousel-item
elements because the index goes to negative.WHAT
Fix the index calculation to get always get a positive index (within the length).