nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions

Home Page:https://swiperjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extra warnings Swiper Loop in SvelteKit

alkorlos opened this issue · comments

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