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

Tooltips and Popovers inside a Modal don't work #5014

Closed
HannesWaechter opened this issue Sep 6, 2012 · 16 comments
Closed

Tooltips and Popovers inside a Modal don't work #5014

HannesWaechter opened this issue Sep 6, 2012 · 16 comments
Labels

Comments

@HannesWaechter
Copy link

Thanks to @jonypawks:
Tooltips and popovers inside a modal are supposed to get a higher z-index than the modal itself. The CSS Selector
doesn't apply, since the tooltips and popovers themselves aren't in the .modal container, but only in the body.
For more details, see Comment 2 by @jonypawks.

Here is a Fiddle: http://jsfiddle.net/BqEzt/1/

Probably dropdowns in modals aren't working either.

@johnh1981
Copy link

I noticed the tooltips in a modal on my site weren't working either. Rolling back from 2.1.1 css file brings them back.

@jonypawks
Copy link

I think that tooltips on elements inside a modal are supposed to get a higher z-index which isn't happening:

// Recalculate z-index where appropriate,
// but only apply to elements within modal
.modal-open .modal {
  .dropdown-menu {  z-index: @zindexDropdown + @zindexModal; }
  .dropdown.open { *z-index: @zindexDropdown + @zindexModal; }
  .popover       {  z-index: @zindexPopover  + @zindexModal; }
  .tooltip       {  z-index: @zindexTooltip  + @zindexModal; }
}

The tooltips themselves aren't actually in a .modal container since they just get appended to the bottom of the body.

@mandymozart
Copy link

agree with @jonypawks
...definitely a z-index offset

@andrewdeandrade
Copy link

Hey @HannesWaechter,

Thanks for opening this issue! Unfortunately, it looks like it fails to pass the criteria neccessary for submitting to bootstrap. The following things are currently failing:

  • should include a jsfiddle/jsbin illustrating the problem if tagged with js but not a feature

For a full list of issue filing guidelines, please refer to the bootstrap issue filing guidelines.

thanks!

@HannesWaechter
Copy link
Author

Hey @malandrew,

thanks for the hint, here is a Fiddle: http://jsfiddle.net/BqEzt/1/

now let's see if I'm able to update the issue, because it's not only in the documentation....

@demike
Copy link

demike commented Oct 2, 2012

That has been fixed in 2.1.2, commit @88b1e44dd61afd8f08761346555521bd216ed73a

@mdo
Copy link
Member

mdo commented Oct 2, 2012

Yup, resolved in 2.1.2-wip.

@mdo mdo closed this as completed Oct 2, 2012
@mchiareli
Copy link

2.3.1 still has this bug.

@cvrebert
Copy link
Collaborator

@mchiareli: goes under the modal's header, but seems to work otherwise: http://jsfiddle.net/p6BAD/

@akshayakrsh
Copy link

2.3.2 has this bug as well, how to solve it? For now I have used z-index:1060 from css, but the popover positioning is not correct!

@kiev78
Copy link

kiev78 commented May 30, 2014

this is still an issue for me in 3.1.1 version 👎

@cvrebert
Copy link
Collaborator

@kiev78 Works fine AFAICT: http://jsfiddle.net/32UEs/3/

@kiev78
Copy link

kiev78 commented May 30, 2014

http://jsfiddle.net/32UEs/4/ - popover doesn't work

@jonypawks
Copy link

It's not working because you've assigned the container to be the body element. If you change the data-container attribute to be a selector for something inside the modal-body it will work just fine:

http://jsfiddle.net/32UEs/5/

@kiev78
Copy link

kiev78 commented May 31, 2014

Thanks for clarifying @jonypawks - I completely missed that! It is not a bug 👍

@ssao-consultant
Copy link

The container attribute should be unique. Because my project have several modal instance and I tried using .modal-body and it does not enable popover, when I changed the container to some unique ID within modal dialog it does work. I thought this would be using parent element context, but may be it behaves differently.

@twbs twbs locked and limited conversation to collaborators Sep 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests