File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Using shouldCloseOnOverlayClick
2
2
3
- 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 )
You can’t perform that action at this time.
0 commit comments