Closed gkilian closed 6 years ago
This issue is fixed in latest release
@akiran - Can we re-open this? I don't believe that this is resolved.
Although it does seem to quickly load the next image, it's still not loading the image in advance. Thus, while you are in swiping the next images is not there.
This works fine in the Demo example because the next image is off screen, but it doesn't work so well when images are back to back.
Any update on this? Would be really nice to have this.
Hello. Wondering if there was any progress made on this issue
This is essential
@gkilian do you have the code for this? appears this wasn't pulled into this repo yet. i could really use this functionality. cheers -m
@markoshust - I do in our Condenast fork. I'll submit a PR and tag the people in the PR for review
Would love this as well
@akiran - Our implementation on Conde requires the use of a added prop lazyLoadOffset
. A secondary PR of mine was closed due to the fact that it supported a non slick-js
prop. https://github.com/akiran/react-slick/issues/429
Would this be the case for this issue as well? I would hate to write a PR if the end result is the same.
I'm afraid we cannot accept props that deviate from slick libary as for now.
@akiran - can we have a discussion on how we can work together to rectify these issues, instead of denying them and closing. Our end goal at Conde is to move back to this library over mantaining our fork. In doing so, we need to rectify these issues.
From the conversations on this issue and in https://github.com/akiran/react-slick/issues/429 - it seems that this plagues more than just our organization.
If we're going in a direction where we're not introducing props which aren't native to slick-js
are we comfortable with defaulting the offset
to 1? I understand this is the current functionality, however it's not working properly.
@gkilian We are strict about not adding new props because that will increase maintenance burden over long terms. We are already running into issues where fix to one mode is effecting other modes. Adding more options will only make it worse. We are trying our best to fix existing issues.
We will be happy to accept PRs that fixes the issues with out adding new props at the moment.
For this case, will it be possible to implement prefetching logic in the wrapper component of Slider. We will be happen add such solutions to documentation
@akiran I'm also using the react-slick and I want to load the offset amount of images. Is there any possibility of coming this feature in near future?
Hello. Any updates on this issue? Can we at least set the default offset to 3 instead of 1?
This would be such a great addition, any hints as to where to start on this if there isn't any existing work already ongoing?
@sergiubologa @joshdavenport - It seems the approach we took at Conde, of adding a prop, is a no go in this repo. Let me see what I can do to get a public version of our fork on my account and highlight the changes we made to get this done.
Possible alt. solution: I could submit a PR without adding the prop, but I'd need the accepted offset amount. If that's 1
then I could also just add that.
There's a new PR trying to solve this issue: https://github.com/akiran/react-slick/pull/1496
The problem is the last approved PR was 2 months ago 😞
@gkilian either of those actions would be worth doing imo.
In the context of this repo, surely even just lazyloading ahead by one by default when using ondemand is totally acceptable without giving the ability to change. Struggle to see that anybody would see that as a bad thing.
Definitely appears there is a hunger here for a more opinionated version of this slick component where there's scope to add nice features on top. Totally understand the difficulty though, as the comment from @akiran indicates. Perhaps it is more effort than it's worth. 🤷♂️
I found a pretty nice work around to get the previous and next images lazy loading. Add centerMode: true
, centerPadding: 1px
, so the left and right images are showing one pixel, then set margin: 0 -1px
and overflow: hidden
on the parent so it hides the images again.
Looks identical to the default slider but with 1 offset image lazy loading.
Proposal:
Allow for an offset of images to be lazy loaded, rather than just the one.
Problem:
Currently when swiping through a set of images with
lazyLoad
set totrue
, the next image in the queue doesn't start loading until you've committed to the swipe. This causes a second (like in the react-slick examples) or more (when using large images) of no image loaded in the slide.Solution:
By implementing something along the lines of
lazyLoadOffset
, we can add a ranges of images to be loaded from the start. Then progressively load the others as the user continues to swipe.I'm not sure if the community is interested in this functionality. My team has implemented this in our fork of react-slick and are willing to help port over the code if wanted.