Add cleanup functions for image view

pull/21833/head
Jaiwanth 2021-05-04 16:42:22 +05:30
parent 8dbcc85249
commit 3eea1b8369
1 changed files with 2 additions and 0 deletions

View File

@ -114,6 +114,8 @@ export default class ImageView extends React.Component<IProps, IState> {
componentWillUnmount() { componentWillUnmount() {
this.focusLock.current.removeEventListener('wheel', this.onWheel); this.focusLock.current.removeEventListener('wheel', this.onWheel);
window.removeEventListener("resize", this.calculateZoom);
this.image.current.removeEventListener("load", this.calculateZoom);
} }
private calculateZoom = () => { private calculateZoom = () => {