Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow Modal Close on Backdrop Click #3490

Closed
tjwebb opened this issue May 15, 2012 · 5 comments
Closed

Disallow Modal Close on Backdrop Click #3490

tjwebb opened this issue May 15, 2012 · 5 comments

Comments

@tjwebb
Copy link

tjwebb commented May 15, 2012

It is often the case that Modal dialogs are used to direct user action to some acceptance action, e.g. clicking on "Okay" button. Currently, I see no way to "lock" the user into a modal dialog until they click Ok. They can simply click anywhere on the background to exit the Modal. Even the example Modal has two buttons called "Save Changes" and "Cancel". What does a backdrop click mean? Often, a user could click the Backdrop by accident and then not know what happened.

Can you implement a feature that lets me disallow backdrop clicking to exit a modal?

@lpinca
Copy link

lpinca commented May 15, 2012

Yuo can use 'static' option for a backdrop which doesn't close the modal on click.

$('#myModal').modal({keyboard:false,backdrop:'static'});

@fat
Copy link
Member

fat commented May 20, 2012

yep @lpinca is right, thanks!

@fat fat closed this as completed May 20, 2012
@dowlin0820
Copy link

I want to disallow keyboard and backdrop at runtime, for example, when a specific event is triggered. It seems I can't do it. Once a modal is initialized with keyboard:true and backdrop:false, it is ALWAYS like that. How can I cancel the two options then?

@ravikantsoni
Copy link

I have to use "backdrop : false" but it should close model, so that on next click, i can get that modal

@YOA
Copy link

YOA commented Jan 29, 2013

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants