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

Tooltip misplacement with "top auto" #14322

Closed
gharlan opened this issue Aug 5, 2014 · 7 comments
Closed

Tooltip misplacement with "top auto" #14322

gharlan opened this issue Aug 5, 2014 · 7 comments

Comments

@gharlan
Copy link

gharlan commented Aug 5, 2014

http://jsbin.com/risupocu/2/

I would expect that the tooltip is shown on bottom..

@cvrebert cvrebert added the js label Aug 5, 2014
@cvrebert cvrebert added this to the v3.2.1 milestone Aug 5, 2014
@tlindig
Copy link
Contributor

tlindig commented Aug 5, 2014

May be it is time to rewrite the tooltip and popover and outsource the complexity of position calculation to a specialized pluglin like PosititionCalculator . OK, that is from myself but it does what you need.

Then the bootstrap tooltip and popover only need to apply the calculated position, add the correct class for orientation (to get the arrow to the right side) and manage events.

Here is an simple example: http://jsbin.com/sifec/9/edit?html,js,output

You would get for free the auto position with flip and stick depending on a viewport / boundary with 9 possible placements instead of the 4 you now supports.

@hnrch02
Copy link
Collaborator

hnrch02 commented Aug 5, 2014

@tlindig That's definitely out of the scope of this bug report. Please file a separate issue with your proposal and we can discuss your suggestion there.

@cvrebert
Copy link
Collaborator

cvrebert commented Aug 5, 2014

(Another library option is http://github.hubspot.com/tether/ )

@Saranya-Raaj
Copy link

MO, this is not a bug. By specifying “auto top”, you meant to display the tip on the top when possible otherwise bottom. Since you have room for showing tip it appears on top. You can refer this bin where tip is showed on bottom when no room is available. Just my thought. Correct me if i am wrong.
You could force the tip to show on bottom by specifying “bottom” alone like tooltip2 element in the above jsbin example.

@tlindig
Copy link
Contributor

tlindig commented Sep 5, 2014

@Matrixz The bug is, that it do not care the given viewport: 'section', the container with the red border.

Saranya-Raaj pushed a commit to Saranya-Raaj/bootstrap that referenced this issue Sep 9, 2014
@gharlan
Copy link
Author

gharlan commented Oct 7, 2014

@hnrch02 Thanks for your fix.

But there is a new case where the placement is wrong with "auto top": http://jsbin.com/risupocu/11/
The first tooltip is correct now. But the second one (scroll to second tooltip item and hover it) is wrong, the tooltip should be on top.

@hnrch02
Copy link
Collaborator

hnrch02 commented Oct 7, 2014

@gharlan Please file a new issue.

@twbs twbs locked and limited conversation to collaborators Oct 7, 2014
Saranya-Raaj pushed a commit to Saranya-Raaj/bootstrap that referenced this issue Oct 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants