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

Extra warnings Swiper Loop in SvelteKit #7519

Open
5 of 6 tasks
alkorlos opened this issue May 6, 2024 · 0 comments
Open
5 of 6 tasks

Extra warnings Swiper Loop in SvelteKit #7519

alkorlos opened this issue May 6, 2024 · 0 comments

Comments

@alkorlos
Copy link

alkorlos commented May 6, 2024

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/devbox/sveltekit-swiper-extra-warning-9qzgdc?file=%2Fsrc%2Froutes%2Findex.svelte%3A3%2C1-3%2C12&workspaceId=0034331e-9b42-40b3-b5ad-c09d460d09c8

Bug description

In the example, there are two sliders. Currently, there are two issues with Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters

First issue: For the second slider, the warning is triggered twice.

Second issue: For the first slider, the warning is mistakenly triggered. It occurs only when there's a second slider with 'number of slides is not enough for loop mode' placed after the first slider in the code. If you swap the sliders in the code, the first slider won't have this warning.

In Swiper Element, this issue doesn't exist.
I check "Make sure this is a Swiper issue and not a framework-specific issue *", but I don't know how to check for sure this problem is on the Swiper side or in SvelteKit. If it's on the SvelteKit side, perhaps you can help open a well-formulated issue in their repository, if simply report this issue, it will be closed as a component issue.

Expected Behavior

Triggered warning only once.
No mistakenly warning.

Actual Behavior

Triggered warning twice.
Mistakenly warning.

Swiper version

11.1.1

Platform/Target and Browser Versions

Chrome 124

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
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

No branches or pull requests

1 participant