Correctly remove reference to debounced updateSliderHeight method (https://github.com/woocommerce/woocommerce-admin/pull/4522)
This commit is contained in:
parent
69b11c30db
commit
9e03657451
|
@ -21,21 +21,18 @@ class Slider extends Component {
|
||||||
this.container = createRef();
|
this.container = createRef();
|
||||||
this.onEnter = this.onEnter.bind( this );
|
this.onEnter = this.onEnter.bind( this );
|
||||||
this.updateSliderHeight = this.updateSliderHeight.bind( this );
|
this.updateSliderHeight = this.updateSliderHeight.bind( this );
|
||||||
|
this.debouncedUpdateSliderHeight = debounce( this.updateSliderHeight, 50 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the slider height on Resize
|
* Update the slider height on Resize
|
||||||
*/
|
*/
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
// Update the slider height on Resize
|
window.addEventListener( 'resize', this.debouncedUpdateSliderHeight );
|
||||||
window.addEventListener(
|
|
||||||
'resize',
|
|
||||||
debounce( this.updateSliderHeight, 50 )
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
window.removeEventListener( 'resize', this.updateSliderHeight )
|
window.removeEventListener( 'resize', this.debouncedUpdateSliderHeight );
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSliderHeight() {
|
updateSliderHeight() {
|
||||||
|
|
Loading…
Reference in New Issue