Skip to content

Commit e9911fb

Browse files
fix(echarts): prevent tooltip crash during dashboard auto-refresh (apache#39277)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 69c8eef commit e9911fb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

  • superset-frontend/plugins/plugin-chart-echarts/src/components

superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,24 @@ function Echart(
277277
chartRef.current?.setOption(themedEchartOptions, {
278278
notMerge,
279279
replaceMerge: notMerge ? undefined : ['series'],
280-
lazyUpdate: isDashboardRefreshing,
280+
// lazyUpdate defers render, causing tooltip crashes on stale shapes (#39247)
281+
lazyUpdate: false,
281282
});
282283
}
283284
// eslint-disable-next-line react-hooks/exhaustive-deps -- isDashboardRefreshing intentionally excluded to prevent extra setOption calls
284285
}, [didMount, echartOptions, eventHandlers, zrEventHandlers, theme, vizType]);
285286

287+
// Clear tooltip on refresh start to avoid stale content (#39247)
288+
useEffect(() => {
289+
if (didMount && isDashboardRefreshing && chartRef.current) {
290+
chartRef.current.dispatchAction({ type: 'hideTip' });
291+
chartRef.current.dispatchAction({
292+
type: 'updateAxisPointer',
293+
currTrigger: 'leave',
294+
});
295+
}
296+
}, [didMount, isDashboardRefreshing]);
297+
286298
useEffect(() => () => chartRef.current?.dispose(), []);
287299

288300
// highlighting

0 commit comments

Comments
 (0)