Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit aa44991

Browse files
authored
refactor(animation): Remove transformStyleProperties export (#4453)
Mirrors #4407 (comment) from the `feat/typescript` branch. BREAKING CHANGE: The `transformStyleProperties` array export has been removed from `mdc-animation`. Please use `getCorrectPropertyName(window, 'transform')` instead.
1 parent 70672f1 commit aa44991

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/mdc-animation/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ function getAnimationName(windowObj, eventType) {
126126
// Public functions to access getAnimationName() for JavaScript events or CSS
127127
// property names.
128128

129-
const transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform'];
130-
131129
/**
132130
* @param {!Object} windowObj
133131
* @param {string} eventType
@@ -146,4 +144,4 @@ function getCorrectPropertyName(windowObj, eventType) {
146144
return getAnimationName(windowObj, eventType);
147145
}
148146

149-
export {transformStyleProperties, getCorrectEventName, getCorrectPropertyName};
147+
export {getCorrectEventName, getCorrectPropertyName};

packages/mdc-linear-progress/foundation.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424
import MDCFoundation from '@material/base/foundation';
25-
import {transformStyleProperties} from '@material/animation/index';
25+
import {getCorrectPropertyName} from '@material/animation/index';
2626

2727
import {cssClasses, strings} from './constants';
2828

@@ -100,8 +100,6 @@ export default class MDCLinearProgressFoundation extends MDCFoundation {
100100

101101
setScale_(el, scaleValue) {
102102
const value = 'scaleX(' + scaleValue + ')';
103-
transformStyleProperties.forEach((transformStyleProperty) => {
104-
this.adapter_.setStyle(el, transformStyleProperty, value);
105-
});
103+
this.adapter_.setStyle(el, getCorrectPropertyName(window, 'transform'), value);
106104
}
107105
}

0 commit comments

Comments
 (0)