Skip to content

Commit

Permalink
[fixed] mouse up event on overlay triggered the closing of the modal
Browse files Browse the repository at this point in the history
  • Loading branch information
WemkoDijkhuis authored and diasbruno committed Apr 2, 2018
1 parent d6f3463 commit d8c3dad
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -286,7 +276,6 @@ export default class ModalPortal extends Component {
if (!this.props.shouldCloseOnOverlayClick && event.target == this.overlay) {
event.preventDefault();
}
this.moveFromContentToOverlay = false;
};

handleContentOnClick = () => {
Expand All @@ -295,7 +284,6 @@ export default class ModalPortal extends Component {

handleContentOnMouseDown = () => {
this.shouldClose = false;
this.moveFromContentToOverlay = false;
};

requestClose = event =>
Expand Down Expand Up @@ -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"
>
<div
Expand Down

0 comments on commit d8c3dad

Please sign in to comment.