fix(animations): ensure position
and display
styles are handled outside of keyframes/web-animations (#28911)
When web-animations and/or CSS keyframes are used for animations certain CSS style values (such as `display` and `position`) may be ignored by a keyframe-based animation. Angular should special-case these styles to ensure that they get applied as inline styles throughout the duration of the animation. Closes #24923 Closes #25635 Jira Issue: FW-1091 Jira Issue: FW-1092 PR Close #28911
This commit is contained in:
@ -157,10 +157,13 @@ function writeStyleAttribute(element: any) {
|
||||
element.setAttribute('style', styleAttrValue);
|
||||
}
|
||||
|
||||
export function setStyles(element: any, styles: ɵStyleData) {
|
||||
export function setStyles(element: any, styles: ɵStyleData, formerStyles?: {[key: string]: any}) {
|
||||
if (element['style']) {
|
||||
Object.keys(styles).forEach(prop => {
|
||||
const camelProp = dashCaseToCamelCase(prop);
|
||||
if (formerStyles && !formerStyles.hasOwnProperty(prop)) {
|
||||
formerStyles[prop] = element.style[camelProp];
|
||||
}
|
||||
element.style[camelProp] = styles[prop];
|
||||
});
|
||||
// On the server set the 'style' attribute since it's not automatically reflected.
|
||||
|
Reference in New Issue
Block a user