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.
When enableAutoReload=true and a data attribute changes on an element that had been previously loaded, the element should not be reloaded until it is in the viewport.
Current Behavior
When the element's data attribute changes, lozad immediately reloads the element even when not in the viewport.
Possible Solution
The mutation callback could check if the element is visible. If it is, it calls load as it does currently. Otherwise, it sets the data-loaded attribute to false.
Steps to Reproduce (for bugs)
Create a new lozad observer with enableAutoReload: true
Lazy load an image by moving it on screen
Move the image off screen
Change the data-src attribute on the element
Notice that the src attribute has changed on the element despite not being in the viewport.
The text was updated successfully, but these errors were encountered:
Expected Behavior
When
enableAutoReload=true
and a data attribute changes on an element that had been previously loaded, the element should not be reloaded until it is in the viewport.Current Behavior
When the element's data attribute changes, lozad immediately reloads the element even when not in the viewport.
Possible Solution
The mutation callback could check if the element is visible. If it is, it calls
load
as it does currently. Otherwise, it sets thedata-loaded
attribute to false.Steps to Reproduce (for bugs)
enableAutoReload: true
data-src
attribute on the elementsrc
attribute has changed on the element despite not being in the viewport.The text was updated successfully, but these errors were encountered: