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

Popover position not updated after scrolling (tested 2.1.0) #4605

Closed
sompylasar opened this issue Aug 22, 2012 · 16 comments
Closed

Popover position not updated after scrolling (tested 2.1.0) #4605

sompylasar opened this issue Aug 22, 2012 · 16 comments
Labels

Comments

@sompylasar
Copy link

The popover remains at the same position relative to the page and does not respect the position of the element it was initialized on. Below are two screenshots of the issue reproduced at http://twitter.github.com/bootstrap/javascript.html#modals (message me please if the links become broken).

Scroll the page
Scroll the block

@fat fat closed this as completed Aug 27, 2012
@sompylasar
Copy link
Author

No fiddle is required, the bug reproduces on the main bootstrap page! Have a look.

@fat fat reopened this Aug 27, 2012
@fat
Copy link
Member

fat commented Aug 28, 2012

this is a tricky one, because modal is fixed positioning and tooltip is absolute. We could provide an option for fixed position i suppose tho - @mdo, what do you think?

@andrewdeandrade
Copy link

Hey @sompylasar,

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!

@mdo
Copy link
Member

mdo commented Oct 1, 2012

Hey @malandrew, please leave the triaging of issues to @fat and I for now :). Appreciate the help, but it makes you look like someone who maintains the project and that isn't the case, thus signing you up for extra work. Thanks!

As far as positioning of these, @fat, I think it'd be awesome if we could maintain their positions relative to the elements that triggered them.

@andrewdeandrade
Copy link

@markdotto Yeah, I made a big mistake and it wasn't intentional. I was playing around with the makefile and didn't realize that running make haunt was going to have consequences beyond the project locally on my machine. I did an npm install haunt then make haunt to investigate what it does instead of just going to the docs for haunt on github. I explained what happened in #3550 and I filed an issue in fat/haunt fat/haunt#11

Somehow I totally missed the HAUNT GITHUB ISSUES 4 FAT & MDO ONLY (O_O ) comment. My bad.

@demike
Copy link

demike commented Oct 10, 2012

@fat and @markdotto: as of 2.1.2-wip where the tooltips and popovers are insterted after the target element this is an easy one. Just make the modal-body position:relative !

@demike
Copy link

demike commented Oct 10, 2012

Sorry, that triggers a new Problem: the popovers get cut off :(

@Tibo-R
Copy link

Tibo-R commented Nov 16, 2012

Is there any update on this issue ? It would be very cool to have the popover following the element that triggered it.

@demike
Copy link

demike commented Nov 16, 2012

There is a solution. Just tried it. But you need an extra div with position:relative that wraps all your modal body content

<div class="modal-body">
<div style="position:relative"> The content including your popover </div>
</div>

@demike
Copy link

demike commented Nov 16, 2012

sorry, the same cut off again when the modal width is too small :(

@Tibo-R
Copy link

Tibo-R commented Nov 16, 2012

Thanks for the help @demike but if the popover gets cut off it's not a solution I can use...

@Yohn
Copy link
Contributor

Yohn commented Nov 16, 2012

@Tibo-R heres my pull request #5768 basically, you'll want to swap out your tooltip.js with my bootstrap-tooltip.js and then to get it working how you want it, you can use the container option, to tell the popover where to get appended at..
so if its within a modal, you could do data-container=".modal-body" or with javascript

#().popover({
  container: '.modal-body'
})

.modal-body can be any element as long as its on the page

@Tibo-R
Copy link

Tibo-R commented Nov 16, 2012

Thanks I will try this out !

@demike
Copy link

demike commented Nov 16, 2012

That does not solve the problem: the problem is that the combination of y overflow -> scroll and x overflow visible is
not possible (at least tested in chrome)

.modal-body {
overflow-x: visible;
 overflow-y:scroll;
position:relative;

for the modal-body

The scrollbar is the problem

@mdo
Copy link
Member

mdo commented Dec 2, 2012

This has been resolved in 2.2.2-wip.

@mdo mdo closed this as completed Dec 2, 2012
@adibreaban
Copy link

How can I make the Popover to build next to the selector element and not before closing the BODY ?! I tried selector, placement inside and all options with no luck. Any help?

@twbs twbs locked and limited conversation to collaborators Jul 28, 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

8 participants