diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx index e531db67eff..95e31481264 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx @@ -277,12 +277,24 @@ function Echart( chartRef.current?.setOption(themedEchartOptions, { notMerge, replaceMerge: notMerge ? undefined : ['series'], - lazyUpdate: isDashboardRefreshing, + // lazyUpdate defers render, causing tooltip crashes on stale shapes (#39247) + lazyUpdate: false, }); } // eslint-disable-next-line react-hooks/exhaustive-deps -- isDashboardRefreshing intentionally excluded to prevent extra setOption calls }, [didMount, echartOptions, eventHandlers, zrEventHandlers, theme, vizType]); + // Clear tooltip on refresh start to avoid stale content (#39247) + useEffect(() => { + if (didMount && isDashboardRefreshing && chartRef.current) { + chartRef.current.dispatchAction({ type: 'hideTip' }); + chartRef.current.dispatchAction({ + type: 'updateAxisPointer', + currTrigger: 'leave', + }); + } + }, [didMount, isDashboardRefreshing]); + useEffect(() => () => chartRef.current?.dispose(), []); // highlighting