Commit 7f587b20 by Marcus Andersson Committed by GitHub

removed the event listener on will unmount instead of adding it again. (#25844)

parent 8f66f5b1
......@@ -35,7 +35,7 @@ export class ClickOutsideWrapper extends PureComponent<Props, State> {
componentWillUnmount() {
window.removeEventListener('click', this.onOutsideClick, false);
if (this.props.includeButtonPress) {
window.addEventListener('keyup', this.onOutsideClick, false);
window.removeEventListener('keyup', this.onOutsideClick, false);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment