From 97034901291420af844257fc76ac107d4a891f18 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Fri, 11 Aug 2023 13:40:45 -0300 Subject: [PATCH] fix: Tooltips don't disappear on the Heatmap chart (#24959) --- .../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 }) => (