Skip to content

fix: move src attribute to end of <img> tag to fix lazy loading (#1317)#1338

Merged
danielroe merged 2 commits into
nuxt:mainfrom
Ragura:lazy-loading-fix
Apr 23, 2024
Merged

fix: move src attribute to end of <img> tag to fix lazy loading (#1317)#1338
danielroe merged 2 commits into
nuxt:mainfrom
Ragura:lazy-loading-fix

Conversation

@Ragura

@Ragura Ragura commented Apr 23, 2024

Copy link
Copy Markdown
Contributor

As described in this Vue core issue (vuejs/core#10764), using the src attribute before loading results in the lazy-loading being inconsistent across loads. This PR moves the src tag to the last position in the element.

I tested the behavior before and after the change in the playground to confirm it is working correctly. If you want I can also commit the playground page for reference.

Feel free to correct me on anything I might have done wrong, be it in the code or while making this PR. I'm not very experienced with the process of contributing to public repos yet!

@danielroe danielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! 👌

@danielroe danielroe merged commit 55dd189 into nuxt:main Apr 23, 2024
@github-actions github-actions Bot mentioned this pull request Apr 23, 2024
@github-actions github-actions Bot mentioned this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants