fix(animations): properly clean up queried element styles in safari/edge (#23686)
Prior to this patch, if an element is queried and animated for 0 seconds (just a style() call and nothing else) then the styles applied would not be properly cleaned up due to their camelCased nature. PR Close #23686
This commit is contained in:

committed by
Igor Minar

parent
05aa5e0179
commit
3824e3f858
@ -203,3 +203,12 @@ export function getBodyNode(): any|null {
|
||||
export const matchesElement = _matches;
|
||||
export const containsElement = _contains;
|
||||
export const invokeQuery = _query;
|
||||
|
||||
export function hypenatePropsObject(object: {[key: string]: any}): {[key: string]: any} {
|
||||
const newObj: {[key: string]: any} = {};
|
||||
Object.keys(object).forEach(prop => {
|
||||
const newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');
|
||||
newObj[newProp] = object[prop];
|
||||
});
|
||||
return newObj;
|
||||
}
|
||||
|
Reference in New Issue
Block a user