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

loading=lazy not removed from images when stepping backwards #6684

Closed
5 of 6 tasks
dhoulder opened this issue May 16, 2023 · 0 comments
Closed
5 of 6 tasks

loading=lazy not removed from images when stepping backwards #6684

dhoulder opened this issue May 16, 2023 · 0 comments

Comments

@dhoulder
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-lazy-load-images-forked-i41wik?file=%2Findex.html%3A60%2C47

Bug description

Preconditions:

  • Initial slide is somewhere in the middle of the set of slides
  • lazyPreloadPrevNext > 0

Stepping forwards through the slides from the initial slide clears loading=lazy from the images ahead of the current slide.

Stepping backwards through the slides from the initial slide does not clear loading=lazy from images in or before the current slide

May be a problem here

if (i !== activeIndex && i > slideIndexLastInView) unlazy(swiper, i);

Expected Behavior

Images in or prior to the current slide should have loading=lazy removed

Actual Behavior

Images in or prior to the current slide don't have loading=lazy removed

Swiper version

9.3.2

Platform/Target and Browser Versions

Ubuntu 22.04, , Mozilla Firefox 113.0.1, Chromium 113.0.5672.63

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
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