Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to allow next nav element at the end of slides, which returns back to the first slide #5270

Closed
wants to merge 1 commit into from

Conversation

czraptor
Copy link

@czraptor czraptor commented Dec 6, 2021

Hi, I just added small feature for "custom" loop. Recently we had issues with rendering performance of swiper in react and we find out many things in our code to improve and also our UX guys had proposal of making custom loop. This feature allows next navigation element to be shown also at last slide and it allows user to click on it and then it navigates back to first slide. This is much better for performance, since we won't duplicate any slides which would be also rendered and it does help user to navigate back even without loop turned on.

Do you think it would be possible to add this feature to swiper? I also updated app.jsx in react playground, so anyone could try it.
(This is a first time I'm trying to contribute to any GitHub project, so I'm sorry if there is something I should do different in this process.)
Thanks!

of slides, which returns back to the first slide
@nolimits4web
Copy link
Owner

Hi, thanks for your PR. Looks good to me but I would propose couple of small changes:

  • let's rename param name to rewind, as this is what was requested here ("Rewind" option #5003) and how it is called in other libs
  • let's not assign it to swiper instance, and do the checks for just swiper.params.rewind

@nolimits4web
Copy link
Owner

and same functionality should be added on prev click, when we are at first slide and press back button, then it should go to the last slide

1 similar comment
@nolimits4web
Copy link
Owner

and same functionality should be added on prev click, when we are at first slide and press back button, then it should go to the last slide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants