Closed clin211 closed 6 months ago
I want to set the modal not to close when clicking on the background when calling openModal, and also how to set it to close automatically when calling openModal (e.g.: automatically close after 3000ms)
hey @clin211! thank you for your patience. in case you haven't figure out how to make this happen yet:
backBehavior: 'none'
.useEffect
inside the modal component that's being opened should do the trick:
// ./modals/AlertModal.tsx
// ...
useEffect(() => { const timeout = setTimeout(closeAllModals, 3000) return () => clearTimeout(timeout) }, [closeAllModals])
// ...
How to configure the option to close automatically (e.g. after 3000 ms) and not to close when clicking on the background?