Gantt Tooltip Doesn't Get Dismissed


There’s an issue where if you hover over an item and the tooltip appears and then you navigate to another route in angular the tooltip stays on the screen and doesn’t get dismissed. This also happens on the same page if you leave the task, sometimes the tooltip just stays on the screen.


It seems to happen when hovering over a task in the grid, and then moving mouse left off the grid and sometimes the tooltip stays on the screen. As a work around I thought maybe I could just disable the tooltip on the grid by using this from a following forum post:

gantt.attachEvent(“onMouseMove”, function (id, e){
if (e.clientX >= gantt.config.grid_width)
mouse_on_grid = true;
else mouse_on_grid = false;

But my clientX does not start at 0 on the far left side. It looks like my chart starts at 312 X position based on the size of the screen width. So I can’t use the above example to hide tooltips on grid.


We are aware of that issue. It will be fixed in future versions, but I cannot give you any ETA.
Here is a workaround that you can use:
It will work if you move the mouse outside the Gantt container but not outside the browser window or to a different frame like in the snippet.

Also, it seems that you don’t destroy the Gantt instance when you switch to a different tab:
I heard that it is a common practice in Angular to destroy Gantt when switching to another tab or page and create a new Gantt instance when switching back.
However, I cannot suggest to you how to implement it in an Angular way.


For the first solution, gantt.$container does not exist in angular. And the second solution only works with the PRO version. Any other options to hide the tooltip when mouse is off the chart?


That should depend on the Angular application configuration:

Here is an Angular demo where it works:

If you have a different configuration, the idea is to find the Gantt container and detect its boundaries. Then you can use the gantt.ext.tooltips.tooltip.hide() method to hide the tooltip.


The demo project that you have attached doesn’t have tooltips showing or included. I also tried using gantt.ext.tooltips.tooltip.hide() on ngOnDestroy but it still doesn’t hide the tooltip. It stays stuck on the screen. Is there an example project using angular in a non-pro version of the gantt chart on hiding the tooltips when user leaves the chart area?


I sent you that demo project to show that there is the gantt.$container in Angular.

Here is the Angular demo with the GPL version, and there, the tooltip is hidden when you move the mouse outside the Gantt container:
Looks like you need to check one more parentNode to get the actual Gantt container position:

var borders = {
  left: gantt.$container.parentNode.parentNode.offsetLeft, 
  right: gantt.$container.parentNode.parentNode.offsetLeft + gantt.$container.clientWidth,
  top: gantt.$container.parentNode.parentNode.offsetTop,
  bottom: gantt.$container.parentNode.parentNode.offsetTop + gantt.$container.clientHeight


I have implemented the same onMouseMove from the demo project that you attached and my tooltip stills gets stuck being displayed sometimes and the tooltip.hide() doesn’t get rid of it.


It is hard to suggest what might be wrong as I don’t see your code. Please send me a ready demo project and I will check what might be wrong.