Skip to content

Commit c2b148b

Browse files
committed
fixed #1958
1 parent 9c26b25 commit c2b148b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/utils/innerSliderUtils.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export const initializedState = spec => {
133133
currentSlide,
134134
lazyLoadedList
135135
});
136-
lazyLoadedList.concat(slidesToLoad);
136+
lazyLoadedList = lazyLoadedList.concat(slidesToLoad);
137137

138138
let state = {
139139
slideCount,
@@ -161,14 +161,14 @@ export const slideHandler = spec => {
161161
infinite,
162162
index,
163163
slideCount,
164-
lazyLoadedList,
165164
lazyLoad,
166165
currentSlide,
167166
centerMode,
168167
slidesToScroll,
169168
slidesToShow,
170169
useCSS
171170
} = spec;
171+
let { lazyLoadedList } = spec;
172172
if (waitForAnimate && animating) return {};
173173
let animationSlide = index,
174174
finalSlide,
@@ -185,7 +185,7 @@ export const slideHandler = spec => {
185185
animationSlide = index - slideCount;
186186
}
187187
if (lazyLoad && lazyLoadedList.indexOf(animationSlide) < 0) {
188-
lazyLoadedList.push(animationSlide);
188+
lazyLoadedList = lazyLoadedList.concat(animationSlide);
189189
}
190190
state = {
191191
animating: true,
@@ -222,10 +222,11 @@ export const slideHandler = spec => {
222222
if (animationLeft === finalLeft) animationSlide = finalSlide;
223223
animationLeft = finalLeft;
224224
}
225-
lazyLoad &&
226-
lazyLoadedList.concat(
225+
if (lazyLoad) {
226+
lazyLoadedList = lazyLoadedList.concat(
227227
getOnDemandLazySlides({ ...spec, currentSlide: animationSlide })
228228
);
229+
}
229230
if (!useCSS) {
230231
state = {
231232
currentSlide: finalSlide,

0 commit comments

Comments
 (0)