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 template updating and tooltip-append-to-body #155

Open
doctornick42 opened this issue Apr 22, 2016 · 4 comments
Open

Tooltip template updating and tooltip-append-to-body #155

doctornick42 opened this issue Apr 22, 2016 · 4 comments

Comments

@doctornick42
Copy link

Hi! First, thanks for this lib!

I have a problem with updating template if tooltip-append-to-body attribute is set to 'true'.

I use tooltip to show an information that comes from $http.get(). When tooltip is opened the response is not available yet. If tooltip-append-to-body is false, then everything's fine - my Angular controller get server's response, update its scope and I can see this info in the tooltip.

But, if tooltip-append-to-body is true, then after I get the response then tooltip is just closing.
I tried to debug it a bit and found out that after template is modified in my controller then onTooltipTemplateChange event is fired and then this event calls onTooltipShow().
Inside onTooltipShow:

 if ($attrs.tooltipAppendToBody) {
      ...
      removeAppendedTip(tooltipElement); 

And after that the tooltip is closed.

I think it can be caused by that: after this lines inside onTooltipShow there's this code:

if (event && $attrs.tooltipHidden !== 'true') {
    exradicatedTipElement.addClass('_exradicated-tooltip');
    angular.element(window.document.body).append(exradicatedTipElement);
}

If i get the idea right, this code tries to create a copy of the closed tooltip. But unfortunately event variable here is undefined

I'm not sure that I made everything right and even understand everything right but I really stuck with it.

@45kb
Copy link
Member

45kb commented Apr 25, 2016

Hi, which browser and device you tried?

Could be great if you can make a live example with a fiddle or plnkr, usually is not so easy to replicate such issues

@doctornick42
Copy link
Author

Ok, sure, live example is a good thing for situations like that.

Here's plunker with a small pseudo example.
https://plnkr.co/edit/w3t5ANptwHSxZZ3hD7rP?p=preview

You can change tooltip-append-to-body's value and see that this behavior depends on this attribute.

Tried it on PC with FireFox(Ubuntu, Win), Chrome(Win), Chromium(Ubuntu), Opera(Win), so I think that browser doesn't really matter because all of them showed me the same result.

@45kb
Copy link
Member

45kb commented Apr 25, 2016

Thanks, i will try to debug it, you would the tooltip to stay visible while the content change, correct?

@45kb 45kb added bug and removed Waiting Feedback labels Apr 25, 2016
@doctornick42
Copy link
Author

Yep, that's right. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants