This is an automated email from the ASF dual-hosted git repository.

christine pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 501340b  Fix sticky tooltips on nvd3 vizzes
     new 11bace3  Merge pull request #6805 from lyft/xtinec--fix-sticky-tooltip
501340b is described below

commit 501340b5db07d0ec1711dccf0a7e4669fde77192
Author: Christine Chambers <[email protected]>
AuthorDate: Fri Feb 1 14:22:09 2019 -0800

    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.
---
 superset/assets/src/visualizations/nvd3/utils.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/superset/assets/src/visualizations/nvd3/utils.js 
b/superset/assets/src/visualizations/nvd3/utils.js
index 715b19e..92ac3dd 100644
--- a/superset/assets/src/visualizations/nvd3/utils.js
+++ b/superset/assets/src/visualizations/nvd3/utils.js
@@ -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());
   }
 }
 

Reply via email to