We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9012d81 commit d8051f9Copy full SHA for d8051f9
1 file changed
docs/examples/should_close_on_overlay_click.md
@@ -1,7 +1,9 @@
1
# Using shouldCloseOnOverlayClick
2
3
-This example shows using `shouldCloseOnOverlayClick` set to `false` so that closing by clicking on the overlay doesn't work.
+When `shouldCloseOnOverlayClick` is `true` (default value for this property),
4
+it requires the `onRequestClose` to be defined in order to close the <Modal/>.
5
+This is due to the fact that the `react-modal` doesn't store the `isOpen`
6
+on its state (only for the internal `portal` (see [ModalPortal.js](https://github.com/reactjs/react-modal/blob/master/src/components/ModalPortal.js)).
7
-`shouldCloseOnOverlayClick` requires `onRequestClose` in order to close the <Modal/> because `react-modal` does not store `isOpen` in its local state.
-
-[](codepen://claydiffrient/woLzwo)
8
+[disable 'close on overlay click', codepen by claydiffrient](codepen://claydiffrient/woLzwo)
9
+[enable 'close on overlay click', codepen by sbgriffi](codepen://sbgriffi/WMyBaR)
0 commit comments