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
The following issue is only in the RTL mode
If we have allowSlideNext set to false in the RTL mode, the back navigation button (or swipe on mobile) does not work beyond 2nd slide. Even though allowSlidePrev is true. I have the following use case for above scenario
The user should not be able to go to next slide unless a certain action is performed on current slide. Once that action is performed, user is automatically taken to next slide. To achieve this we are setting allowSlideNext to false and once that particular action is performed we are setting allowSlideNext to true and then calling swiper.nextSlide() function and then setting back allowSlideNext to false. This works well in LTR (left to right) mode but does not in RTL (right to left) mode. This also does not work only from the 3rd slide. If we are on 2nd slide and go back, it goes back to 1st but if we are on 3rd slide and then click previous button, it stays on the same slide and does not go back to 2nd slide.
Although I did not do a deep dive in to the code but it may be doing an early return from this if condition in swiper > core > slideTo.js. The below if condition was getting true so an early return might be happening which is preventing it to go to previous slide
Clicking on previous button (or swiping to previous slide) should take the user back to previous slide
Actual Behavior
Clicking on previous button (or swiping to previous slide) does not take the user to previous slide.
Note: Going back to previous slide works on 2nd slide (going from 2nd to 1st), but does not work on 3rd slide. (going from 3rd to 2nd) or from any slide to any slide beyond 2nd slide
Check that this is really a bug
Reproduction link
https://07m9l7.csb.app/
Bug description
The following issue is only in the RTL mode
If we have allowSlideNext set to false in the RTL mode, the back navigation button (or swipe on mobile) does not work beyond 2nd slide. Even though allowSlidePrev is true. I have the following use case for above scenario
The user should not be able to go to next slide unless a certain action is performed on current slide. Once that action is performed, user is automatically taken to next slide. To achieve this we are setting allowSlideNext to false and once that particular action is performed we are setting allowSlideNext to true and then calling swiper.nextSlide() function and then setting back allowSlideNext to false. This works well in LTR (left to right) mode but does not in RTL (right to left) mode. This also does not work only from the 3rd slide. If we are on 2nd slide and go back, it goes back to 1st but if we are on 3rd slide and then click previous button, it stays on the same slide and does not go back to 2nd slide.
Although I did not do a deep dive in to the code but it may be doing an early return from this if condition in swiper > core > slideTo.js. The below if condition was getting true so an early return might be happening which is preventing it to go to previous slide
Expected Behavior
Clicking on previous button (or swiping to previous slide) should take the user back to previous slide
Actual Behavior
Clicking on previous button (or swiping to previous slide) does not take the user to previous slide.
Note: Going back to previous slide works on 2nd slide (going from 2nd to 1st), but does not work on 3rd slide. (going from 3rd to 2nd) or from any slide to any slide beyond 2nd slide
Swiper version
9.1.1
Platform/Target and Browser Versions
macOS
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: