Skip to content

Commit a0298e3

Browse files
committed
Bugfix: empty slide if there are 3 slides in total and user swiped through 4 slides fast
1 parent 1938a36 commit a0298e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/js/main-scroll.js

+6
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ class MainScroll {
249249
if (diffAbs >= 3) {
250250
this._containerShiftIndex += positionDifference + (positionDifference > 0 ? -3 : 3);
251251
diffAbs = 3;
252+
253+
// If slides are changed by 3 screens or more - clean up previous slides
254+
this.itemHolders.forEach((itemHolder) => {
255+
itemHolder.slide?.destroy();
256+
itemHolder.slide = undefined;
257+
});
252258
}
253259

254260
for (let i = 0; i < diffAbs; i++) {

0 commit comments

Comments
 (0)