-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
The position of the tooltip element is not centered when the body scrollbar is displayed. #215
Comments
Depends if the "issue" is an user-related issue or not. We would like to see some markup so I can make an idea. |
This is my markup : Wrapper:
Parent wrapper:
Items:
|
@Rudi-Batubara why not make a codepen or fiddle so we can see this in a real world? |
Similar issue, but when the scrollbar is not displayed. |
@duduik I can't explain that, have no idea how to fix that case. |
@Rudi-Batubara I'm currently investigating that case and I cannot confirm that to be an issue. The issue @duduik posted is confirmed so far. |
* Attempting to fix #215, please @Rudi-Batubara and @duduik test the latest master in your setups and let me know how it goes * Updated V4 demo to showcase a fix for #215, added a tooltip for V3/V4 links in the main navigation * Removed Google+ from share links in both V3/V4 demos
It works on https://jsfiddle.net/wcxkvL53/1/. But on a slightly different markup (the Thank you. |
I suggest you stick to the previous markup for now, we can't check the entire document for a tooltip can we? I hope we can find a reliable solution as soon as possible. |
* please @Rudi-Batubara and @duduik test the latest master in your setups and let me know how it goes
* please @Rudi-Batubara and @duduik test the latest master in your setups and let me know how it goes
I would like to add an important comment on the issue. As we know the original plugin makes use of the popper.js library to process the placement of Tooltip, Popover and Dropdown and I came to the conclusion that our 20-30 lines The most important thing is, our library was never designed to do every feature of the original jQuery plugins, especially this kind of quirks with special markup. This library provides a certain set of features in a way to enable long term maintenance, keeping the code in check on size and consistency. Now I need to know @Rudi-Batubara is your original issue solved with latest code in the master branch? |
@thednp the problem only partially solved. When inner div is from "91vh" to "99vh" it doesn't work as expected... |
@Gruven that issue is expected because we don't implement popper.js. I am open to any suggestion on how to reliably manage the vh based popover/tooltip target containers. |
@thednp this not about vh based containers. This bug appears when body height is close to the bottom of viewport. |
@Gruven it's not a bug, it's a case not handled yet, that's why I say we're open to suggestions. |
@thednp do you know why rect from utils bootstrap.native/lib/V4/utils.js Line 248 in 92ccb11
and rect from my custom script
returns different values when this case appears?
|
@thednp success! It works! Please, add after this bootstrap.native/lib/V4/tooltip-native.js Line 80 in 92ccb11
this lines or similar
|
@Gruven the difference comes from two moments in time:
For some reason, Tooltip component changes the values of the viewport like About your suggestion, please make it clear what exactly is the suggested change, because I don't understand the need to set position for |
@thednp as I understood:
We need to set init position for tooltip between steps 2 and 3, because it takes some space within container, so scroll appears on some moment. |
@Gruven not exactly, if you read the code, you will actually find:
But I think you make a good point in a comment above, setting top and left positions to ZERO before adding it to the DOM, because Bootstrap 4 uses popper.js and thus is doesn't need these coordinates to be set in the CSS like Bootstrap 3. |
@thednp no, after appending it is already displayed. After this line bootstrap.native/lib/V4/tooltip-native.js Line 120 in 92ccb11
Tooltip appears at the bottom of the container with "position: absolute", "display: block" and "opacity: 0". (screenshots - https://send.firefox.com/download/2d0e1142c769ab83/#cEniBIy_X_V3vBMYPs_28g ) So let's see the next line bootstrap.native/lib/V4/tooltip-native.js Line 121 in 92ccb11
And then to the next bootstrap.native/lib/V4/tooltip-native.js Line 97 in 92ccb11
This sent us to var declaration, where rect is calculating bootstrap.native/lib/V4/utils.js Line 248 in 92ccb11
By that time tooltip already appended and displayed with "opacity: 0". Scroll is displayed too. So we get wrong calculation of rect values. |
@thednp I think a better solution will be something like "left: -{tooltipOuterWidth}px" and "top: -{tooltipOuterHeight}px" |
@Gruven I will try the first solution first, I think that makes alot more sense. Update I've already tested and I like the result, I think this fixes all possible inconsistencies reported here or other future ones, I will commit to master soon, hope all you guys do some tests and provide feedback. Stay sharp. |
* Reverting to previous version of the `styleTip` utility * Applying the suggested fix #215 (comment) thanks to @Gruven Please @Rudi-Batubara @duduik test and provide feedback.
* Reverting to previous version of the `styleTip` utility * Applying the suggested fix #215 (comment) thanks to @Gruven Please @Rudi-Batubara @duduik test and provide feedback.
@Gruven @duduik @Rudi-Batubara please do a final test, we need to push a new build into the cloud as soon as we can. |
@thednp already done 145defd#comments |
Alright guys we're good. This is now 100% closed. |
I am using
and found all positions of tooltip element not really centered when body scrollbar is displayed. Is there a practical way to fix this bug?
Bug preview :
Fine preview:
Could you please help me to fix this bug ?
The text was updated successfully, but these errors were encountered: