mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(echarts): prevent tooltip crash during dashboard auto-refresh (#39277)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
69c8eef78e
commit
e9911fbac4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user