Ngx-bootstrap: Tooltip text does not update immediately while tooltip is open when binding value changes

Created on 27 Apr 2018  路  8Comments  路  Source: valor-software/ngx-bootstrap

Bug description or feature request:

I want to dynamically fetch data in my tooltip and first show something like "Fetching data" and then show the value once http call completes. However, if I change the text binding, it does not update the tooltip until the next time I hover over the item.

Plunker/StackBlitz that reproduces the issue:

I have created this where clicking on the item triggers a change in the value. But you can see that the tooltip text does not change until I leave and re-hover.

https://stackblitz.com/edit/ngx-bootstrap-ee5w8k

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: "^2.0.0-beta.11"

Angular: 5+

Build system: Angular CLI, System.js, webpack, starter seed:

Angular CLI

comp(tooltip) enhancement

Most helpful comment

Still facing the same issue.. using ngx-bootstrap 3.0.1

All 8 comments

that's true
when we were implementing tooltips I had 2 options:

  • make tooltip content dynamic and kill performance
  • or make them static after they are shown

as you can guess we took a second pass, but in latest angular version there are ways to get those two,
so I will try too

Thank you, appreciate it. Alternatively, maybe add a method that can be called from the component to refresh the tooltip?

It's basically hide()/show()

Yes, but that removes the tooltip and adds it back. A refresh method which would only change the text in the tooltip would be nice

Still facing the same issue.. using ngx-bootstrap 3.0.1

I think the refresh would be really helpfull.

@aks1994 you can use a template in tooltip content
(https://valor-software.com/ngx-bootstrap/#/tooltip#custom-content-template)

https://stackblitz.com/edit/ngx-bootstrap-a1t7k5

@filipemansano your solution works flawlessly.
cheers

Was this page helpful?
0 / 5 - 0 ratings