You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the situation that you initialize the gallery without images and doing a refresh() afterwards, the preload functionality is not working.
This is caused by a bug in the function normalizeSettings(). This function sets the preload setting to 0 if there were no images.
Of course a reset() afterwards doesn't help, because the setting is already overwritten.
It seems better to do the Math.min check during the preload itself.
Steps to reproduce
Initialize the gallery with a nonzero preload, but no images.
Refresh the gallery with some images. Now the preload doesn't work.
Sample HTML markup
Environment
Browser and version - Chrome Version 130.0.6723.117 (Official Build) (64-bit)
OS - Windows 10
lightGallery version - 2.7.1
Additional context
The text was updated successfully, but these errors were encountered:
Description
In the situation that you initialize the gallery without images and doing a refresh() afterwards, the preload functionality is not working.
This is caused by a bug in the function normalizeSettings(). This function sets the preload setting to 0 if there were no images.
Of course a reset() afterwards doesn't help, because the setting is already overwritten.
It seems better to do the Math.min check during the preload itself.
Steps to reproduce
Sample HTML markup
Environment
Additional context
The text was updated successfully, but these errors were encountered: