From d853ce3d3c2e2872fffc7fc5ec9003f322a8a8da Mon Sep 17 00:00:00 2001 From: waterWang Date: Sun, 9 Aug 2026 20:32:31 +0800 Subject: [PATCH] fix(toolbox): reset dataZoom active state on restore The toolbox dataZoom feature's `_isZoomActive` flag was not being reset when the `restore` action was dispatched. This caused the zoom toggle button to behave incorrectly after a chart restore: clicking "Enable drag zoom" would toggle off instead of on, because the stale `_isZoomActive` was still `true` from a previous zoom session. Fix: check for the `restore` payload type in `updateZoomBtnStatus` and reset `zoomActive` to `false`, ensuring the brush controller is properly disabled after restore and can be re-enabled cleanly on next activation. close #21661 --- src/component/toolbox/feature/DataZoom.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/component/toolbox/feature/DataZoom.ts b/src/component/toolbox/feature/DataZoom.ts index 0c57324def..f5d2d09225 100644 --- a/src/component/toolbox/feature/DataZoom.ts +++ b/src/component/toolbox/feature/DataZoom.ts @@ -295,6 +295,8 @@ function updateZoomBtnStatus( if (payload && payload.type === 'takeGlobalCursor') { zoomActive = payload.key === 'dataZoomSelect' ? payload.dataZoomSelectActive : false; + } else if (payload && payload.type === 'restore') { + zoomActive = false; } view._isZoomActive = zoomActive;