diff --git a/src/components/ImageView/index.js b/src/components/ImageView/index.js index 714ddf2b8282..5c8278c86c00 100644 --- a/src/components/ImageView/index.js +++ b/src/components/ImageView/index.js @@ -46,10 +46,14 @@ class ImageView extends PureComponent { if (this.canUseTouchScreen) { return; } + document.addEventListener('mousemove', this.trackMovement.bind(this)); + } + + componentDidUpdate() { + // resize the image when cycled through Image.getSize(this.props.url, (width, height) => { this.setImageRegion(width, height); }); - document.addEventListener('mousemove', this.trackMovement.bind(this)); } componentWillUnmount() {