How to prevent Bootstrap modal from closing when clicking outside
belongs to collection: BOOTSTRAP / SASS Frequently Asked Questions
All Answers
total answers (1)
belongs to collection: BOOTSTRAP / SASS Frequently Asked Questions
total answers (1)
Use the Modal's
backdrop
OptionBy default, if you click outside of the Bootstrap modal window i.e. on the backdrop or dark area it will close and disappear. It also happens when you are inside the modal and press the escape key on the keyboard. But you can prevent this from happening by setting the modal's
need an explanation for this answer? contact us directly to get an explanation for this answerbackdrop
option tostatic
andkeyboard
option tofalse
, as shown in the following example: