Forum Discussion
Custom visual: Tooltip closes after opening
Hi Daniel,
I was trying to keep the relevant parts simple, my total visual is a bit more complicated.
I am iframing an angular app within my visual as I have a map application. The map interface has a "hovertip" that detects when the mouse hovers over the map and then calls an api under my control to retrieve data under the cursor. Normally I would display a tooltip like display in the map, however, I wanted to leverage the Report Page tooltip.
So the map app knows that it is in an embedded context and sends a message back to the visual with the point coordinate and a map-feature identifier (an id).
You would think that was the hard part but it actually is working well.
Note the rectangular area with the heading Shelby is based on a report page. The map and toolbar above it are my app and in an iframe in a visual. The stuff above the visual are slicers and cards in power BI. So, I undstood enough to get that far.
The visual handles a show-tooltip message from the iframe and after gathering relevant information to determine how to apply the id, I execute:
If I move the mouse on the map I will get toolitps as expected and as long as I don't move over the tooltip.
If I go over the tooltip it hides itself (my hide code is not executed) and if I hover over the previous point it will show the tooltip very briefly then hide it; whatever mechanism is hiding the tooltip on mouse over is not getting unset.
Even wierder is that if I hover over a diffrent part of the map it will work ok but when I go over the same area the old tooltip was, the tooltip will do the flashing.
I have tried showing the toolitp at -5000,-5000 in the event there was a container or something handling mouse events but that didn't work either.
It feels like what happens when you think you have destroyed an angular component but one of its handlers has not been removed as a listener or is not checking whether the component has been destroyed. Something that is checking whether the mouse is within an area of a tooltip area that has been removed and thinks the tooltip is in a hide state and so is enforcing the hide.