Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Revert "Prevent scrollbar click to close modal (#3651)" (#3664)

Adrian Gruntkowskiaf9b34a1c6bd
diff --git a/assets/js/dashboard/stats/modals/modal.js b/assets/js/dashboard/stats/modals/modal.js
index b30ec5140c..4b031f3600 100644
--- a/assets/js/dashboard/stats/modals/modal.js
+++ b/assets/js/dashboard/stats/modals/modal.js
@@ -24,7 +24,7 @@ class Modal extends React.Component {
componentDidMount() {
document.body.style.overflow = 'hidden';
document.body.style.height = '100vh';
- document.addEventListener("click", this.handleClickOutside);
+ document.addEventListener("mousedown", this.handleClickOutside);
document.addEventListener("keyup", this.handleKeyup);
window.addEventListener('resize', this.handleResize, false);
this.handleResize();
@@ -33,7 +33,7 @@ class Modal extends React.Component {
componentWillUnmount() {
document.body.style.overflow = null;
document.body.style.height = null;
- document.removeEventListener("click", this.handleClickOutside);
+ document.removeEventListener("mousedown", this.handleClickOutside);
document.removeEventListener("keyup", this.handleKeyup);
window.removeEventListener('resize', this.handleResize, false);
}