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 this example there are two columns, the left column has images with loading=lazy stated after the src attribute. The right column has it started before the src attribute. The blue squares are images. Each image is unique to prevent caching. The squares in the top left and top right turn from red to green when the image is loaded. As you can see in this GIF the right column loads images as I scroll down, working as expected. The left column is always green, indicating that all images are loaded from the start. I've tested in both Firefox and Chrome.
Svelte adds the attributes to the element in the order that they are in the original source. If there are some situations (like lazy loading) where the order matters, this sounds like - at most - something to document, rather than trying to adjust the order that the attributes are added.
Describe the bug
When using native
loading=lazy
to lazy load an image it will only work ifloading=lazy
is stated before you thesrc
attribute.REPL: https://svelte.dev/repl/6c005d5c725e49649693f579ff572d11?version=3.48.0
In this example there are two columns, the left column has images with
loading=lazy
stated after thesrc
attribute. The right column has it started before thesrc
attribute. The blue squares are images. Each image is unique to prevent caching. The squares in the top left and top right turn from red to green when the image is loaded. As you can see in this GIF the right column loads images as I scroll down, working as expected. The left column is always green, indicating that all images are loaded from the start. I've tested in both Firefox and Chrome.Reproduction
Lazy loading does not work:
Lazy loading does work:
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: