You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows using `shouldCloseOnOverlayClick` set to `false` so that closing by clicking on the overlay doesn't work.
3
+
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)).
4
7
5
-
`shouldCloseOnOverlayClick` requires `onRequestClose` in order to close the <Modal/> because `react-modal` does not store `isOpen` in its local state.
6
-
7
-
[](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