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

Virtual slides in combination with "auto" slides per view crashes #7301

Closed
5 of 6 tasks
thomasowow opened this issue Feb 9, 2024 · 1 comment
Closed
5 of 6 tasks
Labels

Comments

@thomasowow
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/devbox/swiper-vue-virtual-slides-forked-h3ddkv

Bug description

When using the virtual slides feature in combination with a slidesPerView of 'auto' something in the updateSlides call fails. To be precise the following line throws "getComputedStyle: Argument 1 is not an object":

const slideStyles = getComputedStyle(slide);

Which indeed is true, slide is undefined here.

After some debugging I figured out that there is a mismatch between slides and slidesLength. slides is an empty array whereas slidesLength is a number above the expected 0.

Expected Behavior

It is expected that while using the virtual module, the updateSlides method will not throw when there are no slides yet.

Actual Behavior

It crashes when there are no slides yet.

Swiper version

11.0.6

Platform/Target and Browser Versions

Ubuntu 23.04, Firefox 121.0 (64-bit)

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
@thomasowow thomasowow added the Vue label Feb 9, 2024
@nolimits4web
Copy link
Owner

Check documentation for virtual slides please

Repository owner locked and limited conversation to collaborators Feb 9, 2024
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