splide
splide copied to clipboard
Auto-Scroll extension doesn't work with lazy-load
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
- Use the example from the doc:
<li class="splide__slide"><img data-splide-lazy="path-to-the-image" alt="cat"></li> - In option,
lazyLoad: 'nearby' - Mount with
new Splide( '.splide' ).mount( window.splide.Extensions ); - 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'