fix(common): avoid redundant image fetch on destroy with auto sizes#67060
Open
SkyZeroZx wants to merge 1 commit intoangular:mainfrom
Open
fix(common): avoid redundant image fetch on destroy with auto sizes#67060SkyZeroZx wants to merge 1 commit intoangular:mainfrom
SkyZeroZx wants to merge 1 commit intoangular:mainfrom
Conversation
prevents Chromium from re-fetch image during DOM teardown when using `sizes="auto"` with lazy loading. Fixes angular#67055
SkyZeroZx
commented
Feb 13, 2026
| // with `loading="lazy"`, potentially triggering an unnecessary image fetch based | ||
| // See: https://github.com/angular/angular/issues/67055#issuecomment-3898513831 | ||
| this.destroyRef.onDestroy(() => { | ||
| this.renderer.removeAttribute(this.imgElement, 'loading'); |
Contributor
Author
There was a problem hiding this comment.
I think it’s fine to remove loading here, I validated in tests that we no longer hit the issue, and this shouldn’t affect any user behavior since it only impacts cleanup when the directive is destroyed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevents Chromium from re-fetch image during DOM teardown when using
sizes="auto"with lazy loading.See #67055 (comment)
Fixes #67055