-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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 falls outside viewport on narrow/mobile screens #7399
Comments
Are you using v2.3.1? (#6713 improved the handling of such cases.) |
#6713 is the tooltips. |
Popovers are built on top of tooltips. That's why using them requires also including the tooltip JS. |
Just an idea: |
Of course it would, we just haven't had the time to build it ;). |
Maybe something like this (replacement of lines 1194 ~ 1208 Must be a shorter way to code that, but can't think of it (apart from using separate methods for every if check). This will try to place the tooltip somewhere else if there is no room, and will default to the 'right' if there is no room on all sides (as the right position seems to have the best text wrapping). |
Hey, I'm trying to find a solution to this problem as well. Your solution works nonumber? Where exactly do I put it? You said lines 1194 ~ 1208, but I'm not sure where that is. It looks to be around right after this, var old = $.fn.popover $.fn.popover = function (option) { in popover.js; is that correct? Thanks. |
It's a replacement of lines 145 - 163 of https://github.com/twitter/bootstrap/blob/master/js/bootstrap-tooltip.js:
|
@nonumber Thanks for the quick response. I can't seem to get it to work though. It just breaks it for me. :( |
Should be working if you add var to those tpx lines. So:
Don't know why it was working just fine on my setup, but not on JSFiddle. |
Very nice, it works. :) Now all we need is full collision detection and correction (top and bottom). :'D EDIT: Oh I'm silly. This is a different problem really. Disregard me. |
i've written code for this a few times in the issues… i might be open to a pull request for this, but you have to realize its pretty expensive/slow perf wise. closing this issue for now tho |
PR: #7988 |
Why is this still broken in Bootstrap 3? It is even broken on the site for mobile: http://getbootstrap.com/javascript/#popovers |
@jfall We have the |
@cvrebert thanks for telling me about the "auto" command. What would also be great would be some sort of control for the auto direction as it anchors to the top for all situations. Would be nice to be able to have it for col-sm or col-md have it appear on the right and in col-xs appear on top or bottom. |
…dow edge' Fix 'bootstrap popover falls off page if editable is too close to window edge'. Reference: twbs/bootstrap#6713 twbs/bootstrap#7399 https://gist.github.com/nonumber/5257443
comparing the behaviour of auto replacement of datatime picker with popover there are many emprovements to do: when i resize page for example popover lose the right position; |
@publicocean0 Please open a new issue. |
The popover doesn't resize/move when part of it falls outside the viewport.
I think this should happen.
This especially is the case when there is a lot of text in the popover...
Can this be fixed?
The text was updated successfully, but these errors were encountered: