Skip to content

[v9.0.2] Virtual mode and Loop mode do not work together #6343

Closed
@petrot

Description

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-virtual-slides-forked-0v06ns

Bug description

Loop and Virtual mode doesn't work together with this configuration:

Object.assign(swiperEl, {
      loop: true,
      virtual: true,
});
    
swiperEl.initialize();

I tried passing the parameters to the html tags, I got the same error.
<swiper-component loop="true" virtual="true">

In the linked example, when I swipe to right, I get [1-2-3-4-1], and backward: [1-4-3-2-1-4]. It stops sliding after the first step of the new looping circle.

Expected Behavior

No response

Actual Behavior

No response

Swiper version

9.0.2

Platform/Target and Browser Versions

macOs, Chrome 109.0.5414.119 (arm64)

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions