Skip to content

Commit

Permalink
fix(components): fixed issue with navigation, pagination, scrollbar c…
Browse files Browse the repository at this point in the history
…ustom elements added after initialization

fixes #4458
  • Loading branch information
nolimits4web committed Apr 20, 2021
1 parent 097109f commit cfd4efd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/react/update-swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function updateSwiper(swiper, slides, passedParams, changedParams) {
let needPaginationInit;
let needScrollbarInit;
let needNavigationInit;

if (
changedParams.includes('thumbs') &&
passedParams.thumbs &&
Expand All @@ -30,7 +31,7 @@ function updateSwiper(swiper, slides, passedParams, changedParams) {
changedParams.includes('pagination') &&
passedParams.pagination &&
passedParams.pagination.el &&
currentParams.pagination &&
(currentParams.pagination || currentParams.pagination === false) &&
pagination &&
!pagination.el
) {
Expand All @@ -41,7 +42,7 @@ function updateSwiper(swiper, slides, passedParams, changedParams) {
changedParams.includes('scrollbar') &&
passedParams.scrollbar &&
passedParams.scrollbar.el &&
currentParams.scrollbar &&
(currentParams.scrollbar || currentParams.scrollbar === false) &&
scrollbar &&
!scrollbar.el
) {
Expand All @@ -53,7 +54,7 @@ function updateSwiper(swiper, slides, passedParams, changedParams) {
passedParams.navigation &&
passedParams.navigation.prevEl &&
passedParams.navigation.nextEl &&
currentParams.navigation &&
(currentParams.navigation || currentParams.navigation === false) &&
navigation &&
!navigation.prevEl &&
!navigation.nextEl
Expand Down
6 changes: 3 additions & 3 deletions src/svelte/update-swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function updateSwiper(swiper, passedParams, changedParams) {
changedParams.includes('pagination') &&
passedParams.pagination &&
passedParams.pagination.el &&
currentParams.pagination &&
(currentParams.pagination || currentParams.pagination === false) &&
pagination &&
!pagination.el
) {
Expand All @@ -41,7 +41,7 @@ function updateSwiper(swiper, passedParams, changedParams) {
changedParams.includes('scrollbar') &&
passedParams.scrollbar &&
passedParams.scrollbar.el &&
currentParams.scrollbar &&
(currentParams.scrollbar || currentParams.scrollbar === false) &&
scrollbar &&
!scrollbar.el
) {
Expand All @@ -53,7 +53,7 @@ function updateSwiper(swiper, passedParams, changedParams) {
passedParams.navigation &&
passedParams.navigation.prevEl &&
passedParams.navigation.nextEl &&
currentParams.navigation &&
(currentParams.navigation || currentParams.navigation === false) &&
navigation &&
!navigation.prevEl &&
!navigation.nextEl
Expand Down
6 changes: 3 additions & 3 deletions src/vue/update-swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function updateSwiper(swiper, slides, passedParams, changedParams) {
changedParams.includes('pagination') &&
passedParams.pagination &&
passedParams.pagination.el &&
currentParams.pagination &&
(currentParams.pagination || currentParams.pagination === false) &&
pagination &&
!pagination.el
) {
Expand All @@ -41,7 +41,7 @@ function updateSwiper(swiper, slides, passedParams, changedParams) {
changedParams.includes('scrollbar') &&
passedParams.scrollbar &&
passedParams.scrollbar.el &&
currentParams.scrollbar &&
(currentParams.scrollbar || currentParams.scrollbar === false) &&
scrollbar &&
!scrollbar.el
) {
Expand All @@ -53,7 +53,7 @@ function updateSwiper(swiper, slides, passedParams, changedParams) {
passedParams.navigation &&
passedParams.navigation.prevEl &&
passedParams.navigation.nextEl &&
currentParams.navigation &&
(currentParams.navigation || currentParams.navigation === false) &&
navigation &&
!navigation.prevEl &&
!navigation.nextEl
Expand Down

0 comments on commit cfd4efd

Please sign in to comment.