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

Custom navigation issues #6042

Closed
5 of 6 tasks
7iomka opened this issue Sep 7, 2022 · 1 comment
Closed
5 of 6 tasks

Custom navigation issues #6042

7iomka opened this issue Sep 7, 2022 · 1 comment
Labels

Comments

@7iomka
Copy link

7iomka commented Sep 7, 2022

Check that this is really a bug

  • I confirm

Reproduction link

https://stackblitz.com/edit/node-nqguhs?file=src%2Fshared%2Fui%2Fcarousel%2Fcarousel.component.tsx,src%2Fpages%2Fhome%2Fhome.component.tsx

https://node-nqguhs--3000.local.webcontainer.io/
Try it be resizing browser to width less than 400px to see issue.

Bug description

I have custom navigation buttons (custom means it is placed outside of Swiper component)
I configured it with recommendations from this post
We have different variations for slidePerView for some breakpoints.
The main goal is:

  • when items.length > current slidesPerView - enable loop and show navigation
  • when items.length <= current slidesPerView - disable loop (because we don't need duplicated items for example if a we have for example 4 items in row but actual is only 2 items in list) and also hide navigation

Expected Behavior

When loop is enabled, navigation also is updated and prev/next buttons is enabled to navigate.

Actual Behavior

When loop is enabled, navigation state is weird - only prev navigation is allowed
If you try to update navigation state, or destroy and init - only next navigation will be allowed.

Swiper version

8.2.4

Platform/Target and Browser Versions

All

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@7iomka 7iomka added the React label Sep 7, 2022
@nolimits4web
Copy link
Owner

Swiper v9 comes with fully reworked and now different loop functionality. If you have similar issues in Swiper 9, open a new issue with a CodeSandbox showing the issue.

Repository owner locked and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants