fix(animations): normalize final styles in buildStyles #42763
Conversation
Heya, thank you for taking a look at this. The animations package is not a simple one to get your hands dirty on. It would be great if this could have a test. I think the best place for such a test would be in the integration suite located in |
Thank you very much!!! About the test, consider it done! Also the normalizer should definitely not be optional! you're totally right! I'm going to amend it |
f876e92
to
722a99a
42d655a
to
4cd0367
...s/core/test/animation/animations_with_web_animations_integration_spec.ts
Show resolved
Hide resolved
I think this looks good now. I'm marking for presubmit to see how this behaves in Google. |
...s/core/test/animation/animations_with_web_animations_integration_spec.ts
Show resolved
Hide resolved
78d47c3
to
b9ffddc
0e99433
to
cc520c0
lol you noticed that immediately! force of habit to amend the last commit... sorry |
FYI tests in Google's codebase (including a global run) went well. // cc @JoostK |
@dario-piotrowicz thanks for the fix |
the final styles created in buildStyles lack normalization, meaning that pixel values remain as numbers (without "px") and so such properties fail to be correctly set/applied Example: "width: 300" is applies as "width": "300" (and thus ignored) instead of the correct "width": "300px"
the buildTrigger function and AnimationTrigger class are annotated as publicApi which seems wrong and makes changes to the two problematic, so they are being removed here see: https://github.com/angular/angular/pull/42763/files#r671481902
in the animation_trigger.ts file there are unused imports remove them to clean up the file
cc520c0
to
f7e517a
Let's do it! I was waiting for CI to go green. |
the final styles created in buildStyles lack normalization, meaning that pixel values remain as numbers (without "px") and so such properties fail to be correctly set/applied Example: "width: 300" is applies as "width": "300" (and thus ignored) instead of the correct "width": "300px" PR Close #42763
) the buildTrigger function and AnimationTrigger class are annotated as publicApi which seems wrong and makes changes to the two problematic, so they are being removed here see: https://github.com/angular/angular/pull/42763/files#r671481902 PR Close #42763
in the animation_trigger.ts file there are unused imports remove them to clean up the file PR Close #42763
the final styles created in buildStyles lack normalization, meaning that pixel values remain as numbers (without "px") and so such properties fail to be correctly set/applied Example: "width: 300" is applies as "width": "300" (and thus ignored) instead of the correct "width": "300px" PR Close #42763
) the buildTrigger function and AnimationTrigger class are annotated as publicApi which seems wrong and makes changes to the two problematic, so they are being removed here see: https://github.com/angular/angular/pull/42763/files#r671481902 PR Close #42763
in the animation_trigger.ts file there are unused imports remove them to clean up the file PR Close #42763
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
the final styles created in buildStyles lack normalization, meaning that pixel values remain as numbers (without "px") and so such properties fail to be correctly set/applied
Example: "width: 300" would be applied as "width": "300" (and thus ignored) instead of the correct "width": "300px"
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
At the end of animations numerical values are not normalized thus they are not saved correctly
Example with width, notice how the animation widths are ignored at the end:

stackblitz
Issue Number: #24698
What is the new behavior?
numerical values get normalized at animations end thus fixing the issue
Example after fix:

Does this PR introduce a breaking change?