-
Notifications
You must be signed in to change notification settings - Fork 157
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 min-width / max-width #162
Comments
Hi @longzheng we switched to translate because is way lighter and more efficient, no plans to go back to position:absolute it gave much more troubles than this. Actually the auto width was working on the new version of this module, probably some of the latest commits broke that behavior. Need to investigate it, thanks. |
@45kb Fair enough. If you find the version where it was working (or the commit that broke it), I'd love to apply it locally to my dev! |
Yes i will investigate this and tell you as soon aseverything works. |
In the meantime (i say this also to anybody who will read in here) just use a custom class if your template is too big, for example
This is not so easy to fix so it could take some time. |
Yeah I spent a few hours trying all sorts of CSS hacks and tweaks to get it to behave correctly but unfortunately I didn't have any luck. I'm a little skeptical it would have ever worked since I'm pretty sure |
Yes it could be, also display:block; sometimes is annoying... problem is that we can't set the tooltip outside of the parent, since it means having to struggle with tons of lines of javascript and usually they never work well the same... i am trying to find a solution for this, if you have any idea i'm listening, thanks |
Besides the solution I proposed initially, you could use JS to first remove the The problem with this would be if the content of the |
Indeed, going to make such things in javascript will result in many lines of code that will not work perfectly or as expected, the first version main problem was exactly this, that's why we decided to use pure CSS for the new version, and if you look at the code you see it's way lighter, faster and more readable. I was actually thinking about new attributes like |
@45kb Any new ideas on this? |
Not yet, help is appreciated here |
I honestly don't think there's another way. |
any solution so far ? |
You could use git bisect to find the offending commit that broke it. |
In the latest version of angular-tooltips, the
max-width
behavior no longer seems to have an effect.For very long tooltip content, the tooltip is always locked at the minimum
min-width: 100px
size.Current behavior
I've used earlier versions of this library and it used to use absolute positioning to place the tooltip correctly on the page. However in the newer versions, you seem to have switched to a custom
<tooltip>
element with aposition:relative
CSS style.Now the
tip
element is center positioned using thetransform: translateX(50%)
trick. Unfortunately theposition:relative
on the parent has the side effect of the tooltip content no longer having a variable width that will correctly adhere to themax-width
layout. It will always try to be scaled as small as possible.Ideal behavior
Are there any plans to revert the design of this library to its previous behavior so
max-width
works correctly?position: relative
on the<tooltip>
elementtop: XXpx
left: XXpx
values on the<tip>
element from the nearest parent withposition: relative
The text was updated successfully, but these errors were encountered: