Separate preload for main images & thumbnails #287
-
Hello! I have a use case on our project where the main images are quite heavy. And I added separate thumbnail prop to load and see thumbs faster. So for this case it would be great to separate amount of images preloaded for main view and thumbnails. E.g. I have 5 images, I preload only current image and all 5 thumbnails. And when I want to see another image fullsize I pick it and it loads on-demand. Another point for such separation - I currently use dynamic preload number calculation so that thumbnails always fill all available space. When there is a lot of space my preload can be ~12 and then 12 images and 12 thumbs are loading at the same time when I only need 12 thumbs and 1-3 main images. Is there any current mechanic to do this? Is it a good idea to add this feature to later releases? Thanks a lot for the great job on this library! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi there! Thank you for reaching out and describing your use case. In the past, I attempted to implement a separate In the meantime, you can implement a custom lazy-loading image slide wrapper that will allow you to avoid excessive image preloading (though it still exhibits the same visual inconsistency while sliding through non-preloaded images) https://stackblitz.com/edit/yet-another-react-lightbox-287?file=src%2FApp.tsx Please let me know your thoughts. |
Beta Was this translation helpful? Give feedback.
Hi there! Thank you for reaching out and describing your use case. In the past, I attempted to implement a separate
preload
prop for thumbnails, but I wasn't entirely happy with the UX, so I have postponed that idea for now. The main issue I ran into was the animation effect. Today, when you click a thumbnail, the main carousel and the thumbnails track are animated with a sliding effect. So what happens when the thumbnailspreload
prop is greater than the mainpreload
prop is that there is a period of a blank black screen while the carousel is sliding through non-preloaded slides. Do you see this as an issue in your case? I also considered a workaround of adding a separate animation durat…