-
-
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
Prevent popovers from running off the screen #7700
Comments
Also interested in this issue! |
Ditto. Hulu has a good example of this done correctly. Where did you put your code exactly? I've tried several spots that seem right, but it's not working for me. Thanks. |
Same issue here, and also not sure where to insert that... didnt work for me. |
+1 |
1 similar comment
+1 |
To those of you wondering where to put this, we actually monkey-patched the example code above inside bootstrap.js (the popover section, I think), so it's not a suitable workaround if you're using bootstrap.min.js (unless you do the minifying yourself) |
pls refer to #1833 |
@fat I know this is closed more than 9 months now However, Isn't this bug a different issue than #1833. Unless I'm reading it wrong #1833 deals with swapping positions if there is no room. Like top to bottom etc. This deals with for example a bottom tool tip on the right edge of the screen. There is room on the bottom but not to the right. |
+1 |
I ran into the following issue when trying to use bootstrap's popover. The element that triggers the popover is close to the right border of the window, which causes the popover to extend off the screen.
I managed to fix this issue by adding the following piece of code, to where the positioning calculation is done:
This seems to work for bottom and top placements. For left and right placements, you will need to use a slight variation:
Here is the end result, notice how the popover is now all contained inside the window:
I'm really interested in hearing opinions on whether this is the right fix for this issue. I would also like to see this being addressed in the next version of bootstrap.
The text was updated successfully, but these errors were encountered: