You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
For example if options are set to slidesToShow:3, infinite:true and there are only 2 slides in the carousel, the carousel will be shown as empty with a cloneNode error.
It might be due to the calculations for infinite slides, where calculated slideIndex goes into negatives once infiniteCount >= slider.state.length, and a cloneNode error occurs as this.slider.slides[-1] is undefined
## WHY
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 Wikiki#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).
For example if options are set to
slidesToShow:3, infinite:true
and there are only 2 slides in the carousel, the carousel will be shown as empty with acloneNode
error.It might be due to the calculations for infinite slides, where calculated
slideIndex
goes into negatives onceinfiniteCount >= slider.state.length
, and acloneNode
error occurs asthis.slider.slides[-1]
is undefinedhowever I might be wrong, would be cool if there was a fix!
The text was updated successfully, but these errors were encountered: