Skip to content

Commit

Permalink
fix: duplicated items when children count is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Apr 1, 2024
1 parent 117e432 commit d474e4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/track.js
Expand Up @@ -136,7 +136,12 @@ const renderSlides = (spec) => {
);

// if slide needs to be precloned or postcloned
if (spec.infinite && spec.fade === false && !spec.unslick) {
if (
spec.infinite &&
childrenCount > 1 &&
spec.fade === false &&
!spec.unslick
) {
let preCloneNo = childrenCount - index;
if (preCloneNo <= getPreClones(spec)) {
key = -preCloneNo;
Expand Down

0 comments on commit d474e4d

Please sign in to comment.