File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Using shouldCloseOnOverlayClick
22
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 ) ).
47
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