You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/08/14 12:27:06 UTC

[superset] 04/06: fix: Tooltips don't disappear on the Heatmap chart (#24959)

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

michaelsmolina pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5c931b19518e0cea0695f6c92f8403c9f6891a2a
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Fri Aug 11 13:40:45 2023 -0300

    fix: Tooltips don't disappear on the Heatmap chart (#24959)
    
    (cherry picked from commit 97034901291420af844257fc76ac107d4a891f18)
---
 .../plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx       | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx
index 22dde813b6..6e016b4774 100644
--- a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx
+++ b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx
@@ -21,7 +21,12 @@ import { reactify, css, styled } from '@superset-ui/core';
 import { Global } from '@emotion/react';
 import Component from './Heatmap';
 
-const ReactComponent = reactify(Component);
+function componentWillUnmount() {
+  // Removes tooltips from the DOM
+  document.querySelectorAll('.d3-tip').forEach(t => t.remove());
+}
+
+const ReactComponent = reactify(Component, { componentWillUnmount });
 
 const Heatmap = ({ className, ...otherProps }) => (
   <div className={className}>