Skip to content

Commit 37a6ceb

Browse files
SLyHuyclaydiffrient
authored andcommitted
Update README for issue close modal when user click on overlay (#352)
* Update README for issue close modal when user click on overlay #351 * Update ReadMe for #352 #352
1 parent a8b7aa0 commit 37a6ceb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ When using React Test Utils with this library, here are some things to keep in m
219219
- You need to set isOpen={true} on the modal component for it to render its children.
220220
- You need to use the `.portal` property, as in `ReactDOM.findDOMNode(renderedModal.portal)` or `TestUtils.scryRenderedDOMComponentsWithClass(Modal.portal, 'my-modal-class')` to acquire a handle to the inner contents of your modal.
221221

222-
By default the modal is closed when clicking outside of it (the overlay area). If you want to prevent this behavior you can
223-
pass the 'shouldCloseOnOverlayClick' prop with 'false' value.
222+
By default the modal will attempt to close when clicking outside of it (on the overlay area). Because the open and closed state of the modal should be controlled outside of the modal, you need to provide the `onRequestClose` function prop to actually set the state. If you want to prevent the overlay close behavior, you should pass the `shouldCloseOnOverlayClick` props as `false`.
223+
224224
```xml
225225
<Modal
226226
isOpen={bool}

0 commit comments

Comments
 (0)