-
It doesn't look like there's an out-of-the-box way to disable the click outside functionality of a modal. I am building a form in a modal and it would be great to have the ability to disable click outside to avoid accidentally losing the form. I tried the useClickOutside hook but the Modal component doesn't accept a ref so that's a non-starter. Any thoughts on how I can accomplish this without rolling my own custom modal component? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hi @jhegele, I've released a patch that adds this feature, please update to <Modal closeOnClickOutside={false}>
Your form
</Modal> |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response @rtivital! Works perfectly. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to change the behavior for when text is selected inside the modal? For example if you highlight text and move the mouse outside of the modal it will close. This doesn't seem like the intended behavior. |
Beta Was this translation helpful? Give feedback.
Hi @jhegele, I've released a patch that adds this feature, please update to
3.1.3
and disable click outside with: