fix: double loads of the original image when placeholder true
๐ Linked issue
resolves #1683
โ Fix
- [ ] ๐ Documentation (updates to the documentation or readme)
- [x] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description Resolved an issue where images could load more than once in the NuxtImg component. Previously, when a placeholder image was in use, it triggered a new image load even though the main image had already started loading. The update ensures that if a placeholder is already handled, we avoid loading the image again. This change prevents duplicate network requests and avoids unnecessary load events. By removing the preload using new image() instance and adding onLoad to imgAttrs, and using vue reactive to handle the update when placeholderLoaded is true
Hi @danielroe Can we have a look at this fix please, it's really needed on our side. Thanks in advance for the feedback!
would you be able to add a regression test case in ssr.test.ts to reproduce the bug and make sure it doesn't happen again? ๐
@danielroe added
Hey @danielroe, any updates?