Bootstrap: Feature Request: Add animation to modal when its backdrop is static.

Created on 12 Jun 2018  路  9Comments  路  Source: twbs/bootstrap

When the modal has the property:

{backdrop: 'static', keyboard: false}

Or when it has the attributes:

data-backdrop="static" data-keyboard="false"

Obviously, it would not be close if the user tries to click outside of it and also using esc key. Then it should show the user that anything is important in modal (user needs to check modal) by showing any animation like scale to get the user attention there. Like the chrome's clear browser data modal:

ubhyfdbl4s

css feature js

Most helpful comment

What if bootstrap fired a hidePrevented.bs.modal event?
You could then control what happens... perhaps bootstrap could do the animation unless you call preventDefault() on the event

All 9 comments

What if bootstrap fired a hidePrevented.bs.modal event?
You could then control what happens... perhaps bootstrap could do the animation unless you call preventDefault() on the event

Yes! It may be a better solution to handle this situation more easily. Then user will have more options to animate the modal. Like using animate.css.

@bkdotcom this kind of event should be great to do whatever the developer wants to give any feedback.

Agree. In applications with both static and non-static modals, user may be confused with these two different behaviors without feedback (on hide prevented).

It looks like we could fire the event from here:

https://github.com/twbs/bootstrap/blob/32ab52ba2e9dc2549304fcef14dede7806384f34/js/src/modal.js#L355-L359

@Johann-S I just wanted to know if there was a slight chance of getting this new feature for v5? Just asking, I know you guys are busy with this next major release.

Yep why not, it seems useful to me, btw we are open for PRs 馃槃

Can I try to resolve this issue?

@webframing I'm confused about the status of this request. It's still showing "Assignees: No one assigned" on v4.4.0 To do list yet it seems that the request has moved along since and appears resolved now by @anjoshigor #29516

This is in master and will be in v4.4.0 too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alvarotrigo picture alvarotrigo  路  3Comments

ziyi2 picture ziyi2  路  3Comments

knownasilya picture knownasilya  路  3Comments

bellwood picture bellwood  路  3Comments

eddywashere picture eddywashere  路  3Comments