From cae99d940e43f0e93fcd97d31639fcecabd99a80 Mon Sep 17 00:00:00 2001 From: Bruno Dias Date: Mon, 27 Nov 2017 13:36:47 -0300 Subject: [PATCH] [fixed] shouldCloseOnOverlayClick conflict with text inputs. `shouldCloseOnOverlayClick` must only preventDefault() when the click is really on the overlay. closes #566. --- src/components/ModalPortal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ModalPortal.js b/src/components/ModalPortal.js index bf5d25f5..3c8c96e2 100644 --- a/src/components/ModalPortal.js +++ b/src/components/ModalPortal.js @@ -243,7 +243,7 @@ export default class ModalPortal extends Component { }; handleOverlayOnMouseDown = event => { - if (!this.props.shouldCloseOnOverlayClick) { + if (!this.props.shouldCloseOnOverlayClick && event.target == this.overlay) { event.preventDefault(); } this.moveFromContentToOverlay = false;