diff --git a/specs/Modal.events.spec.js b/specs/Modal.events.spec.js index 8c9d5f2b..b24b343b 100644 --- a/specs/Modal.events.spec.js +++ b/specs/Modal.events.spec.js @@ -222,6 +222,7 @@ export default () => { withModal(props, null, modal => { mouseDownAt(moverlay(modal)); mouseUpAt(mcontent(modal)); + clickAt(moverlay(modal)); requestCloseCallback.called.should.not.be.ok(); }); }); @@ -236,9 +237,40 @@ export default () => { withModal(props, null, modal => { mouseDownAt(mcontent(modal)); mouseUpAt(moverlay(modal)); + clickAt(moverlay(modal)); requestCloseCallback.called.should.not.be.ok(); }); }); + + it("click on button containing stopPropagation inside modal shouldn't block closing", () => { + const requestCloseCallback = sinon.spy(); + let innerButton = null; + let innerButtonRef = ref => { + innerButton = ref; + }; + function click(event) { + event.stopPropagation(); + } + + withModal( + { + isOpen: true, + onRequestClose: requestCloseCallback + }, +