I am using Bootstrap modal in a react application . I have a requirement that the modal window should not close when clicking on modal backdrop . For this I am using
which works perfectly fine . But in the next scenario , I want the same modal to close on clicking on backdrop using the following code.
But this is not working .
I tried this too
Please provide a feasible solution for the same.
To close bootstrap modal you can pass 'hide' as option to modal method as follow
Bootstrap also provide events that you can hook into modal functionality, like if you want to fire a event when the modal has finished being hidden from the user you can use hidden.bs.modal event you can read more about modal methods and events here in Documentation