bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Setting backdrop prevents modal from showing.

Open adetwiler opened this issue 15 years ago • 11 comments

When setting backdrop to static or true, backdrop shows, but modal never appears.

The only thing I could find is that the 'in' class does not get applied to this element

<div class="modal hide fade">

adetwiler avatar Oct 28 '11 07:10 adetwiler

Just noticed this issue is related to issue #497.

adetwiler avatar Oct 28 '11 07:10 adetwiler

what browser? could you provide a jsfiddle? thanks!

fat avatar Oct 28 '11 17:10 fat

I am using Google Chrome, I can certainly provide you with a jsfiddle.

http://jsfiddle.net/cm3gx/2/

<div class="modal-backdrop fade in"></div> gets added when I open up the modal, but the class 'in' is never added to the modal div

If I add the class 'in' using Chrome inspector, I am able to see the modal animate in. When the modal appears when I add the class 'in' using Chrome inspector, and click 'Close'. The modal disappears, but the <div class="modal-backdrop fade in"></div> does not get removed from the DOM. This prevents me from clicking anything on the DOM.

Also Chrome does not show any errors or warnings in the debug console.

adetwiler avatar Oct 28 '11 18:10 adetwiler

The jsfiddle is working fine for me running Google Chrome 15.0.874.106 and Chrome 17.0.919.0 on Windows 7.

mkchandler avatar Oct 29 '11 02:10 mkchandler

This issue was due to my error. Closing this issue.

adetwiler avatar Oct 29 '11 03:10 adetwiler

@adetwiler -- I'm having the same issue. What was your error?

stevenklein avatar Nov 04 '11 05:11 stevenklein

@stevenklein

The issue was that I had a fade class in my css that was overwriting the bootstraps fade class. Below is the fade class that is required for backdrop to work correctly:

.fade{
    -webkit-transition:opacity 0.15s linear;
    -moz-transition:opacity 0.15s linear;
    -ms-transition:opacity 0.15s linear;
    -o-transition:opacity 0.15s linear;
    transition:opacity 0.15s linear;
    opacity:0;
}.fade.in{
    opacity:1;
} 

adetwiler avatar Nov 04 '11 06:11 adetwiler

Ahhhhhh just realized what the issue was. I thought your solution was solving something else but I realized the transition end event was never being fired because there was no transition being applied. I cherry picked the modal css from the bootstrap css file (as you probably did) but these lines you pasted aren't located near the rest of the modal css. After adding your stuff, everything works fine...thanks so much for the help!

stevenklein avatar Nov 04 '11 06:11 stevenklein

@stevenklein glad to help :)

adetwiler avatar Nov 04 '11 06:11 adetwiler

@adetwiler - thank you a lot. I had the same problem and your comment was very useful!

imeleshkov avatar Nov 21 '11 13:11 imeleshkov

@adetwiler Thanks so much. I got the same problem and now it's fixed, thanks to you answer~!

YawenDENG avatar Jan 08 '16 06:01 YawenDENG