swiper icon indicating copy to clipboard operation
swiper copied to clipboard

Swiper Angular loop mode cannot be turned off

Open pfei5 opened this issue 3 years ago • 3 comments

Check that this is really a bug

  • [X] I confirm

Reproduction link

https://github.com/pfei5/angular-swiper-loop-bug

Bug description

Say I initialize Swiper for Angular with multiple slides and 'loop' mode turned on. If I then reduce the number of slides to 1, swiper will continue to loop 3 slides that are identical, the one expected slide and the 2 duplicate slides on either end.

Expected Behavior

I expect swiper to remove duplicate slides when I reduce the number of slides to 1 and set the SwiperComponent's 'loop' property to 'false'.

Actual Behavior

Swiper loops 3 identical slides instead of resting on the single provided slide.

Swiper version

7.3.1

Platform/Target and Browser Versions

macOS 11.5.2 Chrome 96

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [X] 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

pfei5 avatar Dec 06 '21 14:12 pfei5

This is not Angular related issue. Also seems to me this is the way it should work. @nolimits4web thoughts?

vltansky avatar Feb 02 '22 17:02 vltansky

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 09:08 stale[bot]

@vltansky I disagree. Reducing the number of slides to 1 and turning off loop mode should not loop 3 identical slides, IMHO.

pfei5 avatar Aug 15 '22 06:08 pfei5

New Swiper v9 doesn't have Angular components anymore, it is recommended to use new Swiper Web Components instead.

nolimits4web avatar Feb 01 '23 10:02 nolimits4web