diff --git a/src/components/ReactSlider/ReactSlider.jsx b/src/components/ReactSlider/ReactSlider.jsx index 4c70491f..de9dd210 100644 --- a/src/components/ReactSlider/ReactSlider.jsx +++ b/src/components/ReactSlider/ReactSlider.jsx @@ -964,7 +964,7 @@ class ReactSlider extends React.Component { const style = { position: 'absolute', touchAction: 'none', - willChange: this.state.index >= 0 ? this.posMinKey() : '', + willChange: this.state.index >= 0 ? this.posMinKey() : undefined, zIndex: this.state.zIndices.indexOf(i) + 1, }; style[this.posMinKey()] = `${offset}px`; @@ -974,7 +974,8 @@ class ReactSlider extends React.Component { buildTrackStyle(min, max) { const obj = { position: 'absolute', - willChange: this.state.index >= 0 ? `${this.posMinKey()},${this.posMaxKey()}` : '', + willChange: + this.state.index >= 0 ? `${this.posMinKey()},${this.posMaxKey()}` : undefined, }; obj[this.posMinKey()] = min; obj[this.posMaxKey()] = max; diff --git a/src/components/ReactSlider/__tests__/__snapshots__/ReactSlider.test.js.snap b/src/components/ReactSlider/__tests__/__snapshots__/ReactSlider.test.js.snap index 999de6f9..187a64df 100644 --- a/src/components/ReactSlider/__tests__/__snapshots__/ReactSlider.test.js.snap +++ b/src/components/ReactSlider/__tests__/__snapshots__/ReactSlider.test.js.snap @@ -18,7 +18,7 @@ exports[` can render 1`] = ` "left": 0, "position": "absolute", "right": 0, - "willChange": "", + "willChange": undefined, } } /> @@ -29,7 +29,7 @@ exports[` can render 1`] = ` "left": 0, "position": "absolute", "right": 0, - "willChange": "", + "willChange": undefined, } } /> @@ -48,7 +48,7 @@ exports[` can render 1`] = ` "left": "0px", "position": "absolute", "touchAction": "none", - "willChange": "", + "willChange": undefined, "zIndex": 1, } }