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

Rework of Lazy Preloader breaks swiper + preloader not working correctly #6946

Closed
5 of 6 tasks
nikitasol opened this issue Aug 17, 2023 · 2 comments · May be fixed by abhishekbedi/framework7#1, Aarod23/nys-site#1, wierza/Team-project#148 or TaylorBundy/swiper#4

Comments

@nikitasol
Copy link

nikitasol commented Aug 17, 2023

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-default-forked-75kk6t?file=%2Findex.html%3A52%2C37

Bug description

Two connected issues:

  • If swiper is initiated above the fold, the first slide should get loading="eager" and the rest loading="lazy". Update "10.2.0" changed Element lazy preloader lookup logic and now all slides have to use lazy="true" in order to work. Can be verified with npm run element adding some images.
  • Even if all slides have lazy="true" and images loading="lazy", the swiper is initialised correctly but preloader always stays visible and never disappears.

Expected Behavior

We should still be able to load the first slide without lazy in eager fashion for the above the fold content. The preloader has to disappear once the image is loaded.

Actual Behavior

No response

Swiper version

10.2.0

Platform/Target and Browser Versions

macOS Safari 16.4 and macOS Chrome 115

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
@github-actions
Copy link

Hello @nikitasol. Please provide a online reproduction by codesandbox or a minimal GitHub repository. You can fork one of our demos in codesandbox to get start. Issues labeled by missing demo will be closed if no activities in 3 days.

@nikitasol
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment