Fix sticky tooltips on nvd3 vizzes

Currently, we attempt to hide the nvd3 tooltips (if any were on screen) before we draw a new viz after rerunning a query. The hiding is done by selecting the first nvtooltip element and setting the opacity to 0.

This somtimes leave behind a trail of old tooltips if a tooltip is left behind by this nvd3 bug https://github.com/novus/nvd3/issues/1262. This PR modifies the behavior of how we clean up tooltips between rerun of queries by selecting all nvd3 tooltips and removing them all from the DOM before redrawing nvd3 vizzes.
This commit is contained in:
Christine Chambers 2019-02-01 14:22:09 -08:00
parent 5669a82350
commit 501340b5db
1 changed files with 3 additions and 3 deletions

View File

@ -166,9 +166,9 @@ export function generateBubbleTooltipContent({
}
export function hideTooltips() {
const target = document.querySelector('.nvtooltip');
if (target) {
target.style.opacity = 0;
const targets = document.querySelectorAll('.nvtooltip');
if (targets.length > 0) {
targets.forEach(t => t.remove());
}
}