From 789596f8c5b9a91da2e9bab7d397a55dc934b8fa Mon Sep 17 00:00:00 2001 From: Christine Chambers Date: Mon, 8 Apr 2019 10:25:55 -0700 Subject: [PATCH] fix: remove sticky tooltip when query returns no data in explore view (#42) Tap into the newly added `willUnmount` hook to clean up sticky tooltip that nvd3 adds to `body` directly. This removes such tooltips that were left behind in the explore view with the new query returns 'no data'. --- .../superset-ui-legacy-preset-chart-nvd3/src/ReactNVD3.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/superset-ui-legacy-preset-chart-nvd3/src/ReactNVD3.js b/packages/superset-ui-legacy-preset-chart-nvd3/src/ReactNVD3.js index 987250436..4bd86803a 100644 --- a/packages/superset-ui-legacy-preset-chart-nvd3/src/ReactNVD3.js +++ b/packages/superset-ui-legacy-preset-chart-nvd3/src/ReactNVD3.js @@ -18,5 +18,10 @@ */ import { reactify } from '@superset-ui/chart'; import Component from './NVD3Vis'; +import { hideTooltips } from './utils'; -export default reactify(Component); +function willUnmount() { + hideTooltips(true); +} + +export default reactify(Component, { willUnmount });