You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Angular animations: the style() function doesn't change property unless it's in camel case #48246
Which @angular/* package(s) are the source of the bug?
animations
Is this a regression?
No
Description
In some circumstances Angular Animations doesn't apply style if the css property is declared inside quotation marks such as 'background-color': 'red'. Here's the post on stackoverflow describing the issue.
Please provide a link to a minimal reproduction of the bug
This is actually working as intended. There's more information on this in our documentation. Essentially this is because the style() definitions rely on the javascript naming for properties, which uses camel case, rather than native CSS definitions. style() definitions are applied on the javascript side. So they need that structure.
This is actually working as intended. There's more information on this in our documentation. Essentially this is because the style() definitions rely on the javascript naming for properties, which uses camel case, rather than native CSS definitions. style() definitions are applied on the javascript side. So they need that structure.
The documentation says it's either can be done with camel case notation or with native css property names wrapped inside quotes.
Use the style() function to define a set of styles to associate with a given state name. You must use camelCase for style attributes that contain dashes, such as backgroundColor or wrap them in quotes, such as 'background-color'.
@jessicajaniuk although under the hood the properties are converted to camelCase, the api does allow the use of standard kabab-case property names, so I do think that @blablaalb is right here.
Moreover I think I might likely have introduced the bug myself by accident back in #42763, sorry for the inconvenience 😓
I''ve created a PR with the fix, and I've also added a unit test so that won't risk regressing this again.
Thanks a bunch @blablaalb for raising the issue! 🙂
Activity
jessicajaniuk commentedon Dec 9, 2022
This is actually working as intended. There's more information on this in our documentation. Essentially this is because the
style()definitions rely on the javascript naming for properties, which uses camel case, rather than native CSS definitions.style()definitions are applied on the javascript side. So they need that structure.blablaalb commentedon Dec 9, 2022
The documentation says it's either can be done with camel case notation or with native css property names wrapped inside quotes.
dario-piotrowicz commentedon Dec 10, 2022
@jessicajaniuk although under the hood the properties are converted to camelCase, the api does allow the use of standard kabab-case property names, so I do think that @blablaalb is right here.
Moreover I think I might likely have introduced the bug myself by accident back in #42763, sorry for the inconvenience 😓
I''ve created a PR with the fix, and I've also added a unit test so that won't risk regressing this again.
Thanks a bunch @blablaalb for raising the issue! 🙂
fix(animations): fix incorrect handling of camel-case css properties
fix(animations): fix incorrect handling of camel-case css properties (#…
angular-automatic-lock-bot commentedon Jan 12, 2023
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.
fix(animations): fix incorrect handling of camel-case css properties (a…