-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
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
Modal z-index issue. Potential Solution. #3217
Comments
Fantastic! Thanks so much for posting a solution. |
Have been bitten by this today. Thanks for the explanation! |
Many thanks, got caught out by this one too! |
gracias, left me extremely confused when this happened to me |
Another solution could be to use InsertAfter to insert the backdrop after the modal. This has the positive side effect that the modal doesn't need to be moved out of place + note: the InsertAfter should be done in the plugin. |
Thanks a lot! The insertAfter seems to fix it for me.
|
Thanks a lot! The insertAfter works for me as in @tompi code. |
Perfect, thanks a lot for resolving this! |
Thank you Thank you Thank you! |
Hello guys, I am having the same issue. I already put the piece of script but its still not working for me. I hope you could help. Thanks in advance. IE 7 problem here: http://www.theeap.com/online-training-tools/online-test.html |
Thanks for the explanation and solution. Works like a charm :) |
@tompi 's fix works. This should get committed asap. |
You saved my bum with this. Thank you! |
Thank you! You saved my day too! |
Thanks, that helped me too! This issue was reproducible in all browsers, .NET project. |
Thanks a lot, the .insertAfter fixed it right away. |
Yep, also hit by this bug, and this fiddle fixed it for me too. Thank you for your time (so long ago!). |
We explicitly don't want to move the element around the dom. The solution is really don't nest your modals in your dom. Just put them at the bottom of the body when you write your markup. |
It isn't always possible to control where the modals are placed in the DOM so blanket statements like that are kind of short sighted. For example, I have a template system that uses russian doll style of generation. A request for a page first renders the innermost template and then cascades upwards from there by rendering the next template and placing the first template within the body of the next template. If the modal is output by the innermost template, it is very difficult to put it at the bottom of the body. Of course, it can be argued that things should be rendered a different way, but the point here is to just say that it isn't always possible to do what you are suggesting. |
Yea, why is this issue closed? This is still a problem. It's not always possible to put modals at the body level. |
Really useful! Thanks! |
Thanks a lot! |
Really useful work on mobile safari ipad |
Thanks a lot dude, working just fine...!!!! |
Why was this issue closed? As some previous posters have indicated it is not always easy to avoid nesting the modal within DOM especially when using any sort of template system or when working with portlets within a portal. Will this be re-considered for a fix? |
thanks a lot! |
Thaks a lot! this was help ful |
I first experienced the modal content displaying beneath the .modal-backdrop scrim in IE7, but I have since seen weird behavior in Chrome.
The problem, in essence, is that .modal and .modal-backdrop are not always siblings with similar attributes. In a recent project I had a deeply nested .modal and there were custom z-indexings elsewhere on the page. Thus, incorrect z-indexing.
I've created a jsFiddle: http://jsfiddle.net/ATeaH/8/ to illustrate the busted and fixed behavior.
Hope this is useful.
The text was updated successfully, but these errors were encountered: