mirror of
https://github.com/grafana/grafana.git
synced 2025-09-29 03:53:48 +08:00
removed the event listener on will unmount instead of adding it again. (#25844)
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user