Skip to content

fix(common): apply fixed_srcset_width values only to fixed srcsets#52486

Closed
atcastle wants to merge 1 commit intoangular:16.2.xfrom
atcastle:fix-sourceset-size-limit
Closed

fix(common): apply fixed_srcset_width values only to fixed srcsets#52486
atcastle wants to merge 1 commit intoangular:16.2.xfrom
atcastle:fix-sourceset-size-limit

Conversation

@atcastle
Copy link
Contributor

@atcastle atcastle commented Nov 1, 2023

(This PR is a copy of #52459, targeting 16.2.x. This bug effects applications using this feature in Angular 16, so the fix makes sense to apply as a patch.)

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

fix fixed_srcseet_width being incorrectly applied to responsive srcsets
@pullapprove pullapprove bot requested a review from dylhunn November 1, 2023 23:13
@AndrewKushnir AndrewKushnir requested review from AndrewKushnir and removed request for dylhunn November 2, 2023 01:23
@AndrewKushnir AndrewKushnir added area: common Issues related to APIs in the @angular/common package target: patch This PR is targeted for the next patch release common: image directive labels Nov 2, 2023
@ngbot ngbot bot added this to the Backlog milestone Nov 2, 2023
@AndrewKushnir AndrewKushnir added the action: merge The PR is ready for merge by the caretaker label Nov 2, 2023
@alxhub
Copy link
Member

alxhub commented Nov 2, 2023

This PR was merged into the repository by commit e092184.

@alxhub alxhub closed this Nov 2, 2023
alxhub pushed a commit that referenced this pull request Nov 2, 2023
…52486)

fix fixed_srcseet_width being incorrectly applied to responsive srcsets

PR Close #52486
@angular-automatic-lock-bot
Copy link

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 3, 2023
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 target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants