Skip to content

Commit d8c3dad

Browse files
WemkoDijkhuisdiasbruno
authored andcommitted
[fixed] mouse up event on overlay triggered the closing of the modal
1 parent d6f3463 commit d8c3dad

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/components/ModalPortal.js

-13
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,6 @@ export default class ModalPortal extends Component {
266266
}
267267
}
268268
this.shouldClose = null;
269-
this.moveFromContentToOverlay = null;
270-
};
271-
272-
handleOverlayOnMouseUp = () => {
273-
if (this.moveFromContentToOverlay === null) {
274-
this.shouldClose = false;
275-
}
276-
if (this.props.shouldCloseOnOverlayClick) {
277-
this.shouldClose = true;
278-
}
279269
};
280270

281271
handleContentOnMouseUp = () => {
@@ -286,7 +276,6 @@ export default class ModalPortal extends Component {
286276
if (!this.props.shouldCloseOnOverlayClick && event.target == this.overlay) {
287277
event.preventDefault();
288278
}
289-
this.moveFromContentToOverlay = false;
290279
};
291280

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

296285
handleContentOnMouseDown = () => {
297286
this.shouldClose = false;
298-
this.moveFromContentToOverlay = false;
299287
};
300288

301289
requestClose = event =>
@@ -348,7 +336,6 @@ export default class ModalPortal extends Component {
348336
style={{ ...overlayStyles, ...this.props.style.overlay }}
349337
onClick={this.handleOverlayOnClick}
350338
onMouseDown={this.handleOverlayOnMouseDown}
351-
onMouseUp={this.handleOverlayOnMouseUp}
352339
aria-modal="true"
353340
>
354341
<div

0 commit comments

Comments
 (0)