From d8c3dada62a464fada249dc49cc842936e6419b6 Mon Sep 17 00:00:00 2001 From: Wemko Dijkhuis Date: Tue, 27 Mar 2018 16:58:12 +0200 Subject: [PATCH] [fixed] mouse up event on overlay triggered the closing of the modal --- src/components/ModalPortal.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/components/ModalPortal.js b/src/components/ModalPortal.js index 7a9f7c81..5220003d 100644 --- a/src/components/ModalPortal.js +++ b/src/components/ModalPortal.js @@ -266,16 +266,6 @@ export default class ModalPortal extends Component { } } this.shouldClose = null; - this.moveFromContentToOverlay = null; - }; - - handleOverlayOnMouseUp = () => { - if (this.moveFromContentToOverlay === null) { - this.shouldClose = false; - } - if (this.props.shouldCloseOnOverlayClick) { - this.shouldClose = true; - } }; handleContentOnMouseUp = () => { @@ -286,7 +276,6 @@ export default class ModalPortal extends Component { if (!this.props.shouldCloseOnOverlayClick && event.target == this.overlay) { event.preventDefault(); } - this.moveFromContentToOverlay = false; }; handleContentOnClick = () => { @@ -295,7 +284,6 @@ export default class ModalPortal extends Component { handleContentOnMouseDown = () => { this.shouldClose = false; - this.moveFromContentToOverlay = false; }; requestClose = event => @@ -348,7 +336,6 @@ export default class ModalPortal extends Component { style={{ ...overlayStyles, ...this.props.style.overlay }} onClick={this.handleOverlayOnClick} onMouseDown={this.handleOverlayOnMouseDown} - onMouseUp={this.handleOverlayOnMouseUp} aria-modal="true" >