splide icon indicating copy to clipboard operation
splide copied to clipboard

Auto-Scroll extension doesn't work with lazy-load

Open karchung0930 opened this issue 3 years ago • 0 comments

Checks

  • [X] Not a duplicate.
  • [X] Not a question, feature request, or anything other than a bug report directly related to Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions

Version

v4.0.7

Description

When we're using lazy-load with the auto-scroll extension, the first few slide works, but the slides after the first few slides would keep loading. After I had inspected it with the developer tools, I found that the data-splide-lazy won't become src but the first few slides do.

Reproduction Link

No response

Steps to Reproduce

  1. Use the example from the doc: <li class="splide__slide"><img data-splide-lazy="path-to-the-image" alt="cat"></li>
  2. In option, lazyLoad: 'nearby'
  3. Mount with new Splide( '.splide' ).mount( window.splide.Extensions );
  4. You would see only the first few lines works but the others remains loading.

Expected Behaviour

The images should be loaded when they are 'nearby'

karchung0930 avatar Jul 23 '22 16:07 karchung0930