Skip to content

fix(common): apply fixed_srcset_width value only to fixed srcsets - #52459

Closed
atcastle wants to merge 1 commit into
angular:mainfrom
atcastle:fix-srcset-size-limit
Closed

atcastle wants to merge 1 commit into
angular:mainfrom
atcastle:fix-srcset-size-limit

Conversation

@atcastle

Copy link
Copy Markdown
Contributor

This fixes a bug in NgOptimizedImage where the FIXED_SRCSET_WIDTH_LIMIT was being applied to both "fixed" and "responsive" srcsets. As the constant name indicates, this is only supposed to apply to fixed images. For responsive images, not generating the srcset in this case is an antipattern, as it prevents the automatic srcset from correctly suggesting a smaller version of the image.

New tests included to prevent regression. CC: @AndrewKushnir @kara

add logic to NgOptimizedImage to keep fixed_srcset_width from applying to large responsive images, which is incorrect behavior
@pullapprove
pullapprove Bot requested a review from jessicajaniuk October 30, 2023 21:43
@jessicajaniuk
jessicajaniuk requested review from AndrewKushnir and removed request for jessicajaniuk October 30, 2023 22:08
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer area: common Issues related to APIs in the @angular/common package target: rc This PR is targeted for the next release-candidate common: image directive labels Oct 30, 2023
@ngbot ngbot Bot modified the milestone: Backlog Oct 30, 2023
@AndrewKushnir
AndrewKushnir requested a review from kara October 30, 2023 22:13

@kara kara left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@AndrewKushnir

Copy link
Copy Markdown
Contributor

Presubmit.

@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: presubmit The PR is in need of a google3 presubmit labels Oct 30, 2023
@AndrewKushnir

Copy link
Copy Markdown
Contributor

Caretaker note: the presubmit is "green" (only unrelated failures), this PR is ready for merge.

@alxhub

alxhub commented Oct 31, 2023

Copy link
Copy Markdown
Member

This PR was merged into the repository by commit f86fb8e.

@alxhub alxhub closed this in f86fb8e Oct 31, 2023
alxhub pushed a commit that referenced this pull request Oct 31, 2023
…2459)

add logic to NgOptimizedImage to keep fixed_srcset_width from applying to large responsive images, which is incorrect behavior

PR Close #52459
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Dec 1, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…gular#52459)

add logic to NgOptimizedImage to keep fixed_srcset_width from applying to large responsive images, which is incorrect behavior

PR Close angular#52459
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: common Issues related to APIs in the @angular/common package common: image directive merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants