You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which saves the interpolation values based on the dimensions of the first controlled swiper which can't be used for another one with different dimensions because it messes up the progress calculation.
I believe it should be enough to remove the condition on line 62 which would allow the swiper.controller.spline to regenerate for every controlled swiper and allow for correct progress calculation.
It is not really very clear from comment in the code why this condition was added so I am not sure if it won't break anything else.
Expected Behavior
When the progress of the swiper with controller is 0.5, the progress of every controlled swiper should also be 0.5.
Actual Behavior
When the progress of the controlling swiper is 0.5 , the progress of the first controlled swiper is correct but the progress of other swipers is based on the size of the first one so the progress values are wrong which causes them to move with wrong speed.
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/swiper-multiple-swipers-forked-dcg4xm?file=%2Findex.html&selection=%5B%7B%22endColumn%22%3A29%2C%22endLineNumber%22%3A65%2C%22startColumn%22%3A29%2C%22startLineNumber%22%3A65%7D%5D
Bug description
When one swiper with controller module controls multiple swipers with different widths it calculates their progress wrong.
I believe the problem is in
swiper/src/modules/controller/controller.js
Line 62 in 8f48d7f
which saves the interpolation values based on the dimensions of the first controlled swiper which can't be used for another one with different dimensions because it messes up the progress calculation.
I believe it should be enough to remove the condition on line 62 which would allow the swiper.controller.spline to regenerate for every controlled swiper and allow for correct progress calculation.
It is not really very clear from comment in the code why this condition was added so I am not sure if it won't break anything else.
Expected Behavior
When the progress of the swiper with controller is 0.5, the progress of every controlled swiper should also be 0.5.
Actual Behavior
When the progress of the controlling swiper is 0.5 , the progress of the first controlled swiper is correct but the progress of other swipers is based on the size of the first one so the progress values are wrong which causes them to move with wrong speed.
Swiper version
9.1.0
Platform/Target and Browser Versions
any
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: