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

Loop property inside hidden container causes error #6718

Closed
5 of 6 tasks
jakubfiglak opened this issue May 31, 2023 · 1 comment
Closed
5 of 6 tasks

Loop property inside hidden container causes error #6718

jakubfiglak opened this issue May 31, 2023 · 1 comment

Comments

@jakubfiglak
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-react-centered-auto-forked-hpcwzz

Bug description

When I try to use loop property on Swiper React component inside a hidden container (with display: none CSS property), my app crashes due to Cannot read properties of undefined (reading 'swiperSlideSize') error. Turning the loop property off makes the error go away.

Expected Behavior

Be able to visually hide a carousel with loop property turned on

Actual Behavior

No response

Swiper version

9.3.2

Platform/Target and Browser Versions

macOS Chrome Version 113.0.5672.126

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
@jakubfiglak
Copy link
Author

I'm not sure the approach to solve my problem is correct in general. I want to have different loop and autoplay behaviour for mobile and desktop and since my attempts to achieve that with breakpoints property failed, I'm just trying to display two different instances of my carousel using CSS. I'd like to hear your opinion about this as well!

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