Skip to content

Commit

Permalink
fix(react): update controller.control on array change
Browse files Browse the repository at this point in the history
fixes #5368
  • Loading branch information
nolimits4web committed Jan 24, 2022
1 parent 8183466 commit 7c53de8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/react/update-swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ function updateSwiper({
}
});

if (
updateParams.includes('controller') &&
!needControllerInit &&
swiper.controller &&
swiper.controller.control &&
currentParams.controller &&
currentParams.controller.control
) {
swiper.controller.control = currentParams.controller.control;
}

if (changedParams.includes('children') && virtual && currentParams.virtual.enabled) {
virtual.slides = slides;
virtual.update(true);
Expand Down

0 comments on commit 7c53de8

Please sign in to comment.