You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Zoom Reset Count Incorrect After Multiple Grids Zoom #21660
You have now performed 2 zoom operations in total.
Click Zoom Reset. It can be triggered 3 times, which is incorrect.
Current Behavior
Zoom Reset can be triggered 3 times, which indicates an error in how zoom history is tracked across multiple grids.
Expected Behavior
Zoom Reset should only be available as many times as actual zoom operations were performed.
In this case, after 2 zooms, Zoom Reset should only be possible 2 times.
Environment
- OS:N/A
- Browser: N/A
- Framework: N/A
This issue can be reduced with Echarts Demo Examples. The issue is independent of my development environment or the browser used in testing.
I can reproduce this on master. Root cause is in src/component/dataZoom/history.ts
pop() doesn't stop when only the origin snapshot remains it returns the origin as a restorable snapshot, so the toolbox "back"/zoom-reset dispatches one extra redundant dataZoom action(reset fires 3× after 2 zooms instead of 2×)
Proposed fix
pop() returns an empty snapshot when only the origin remains (its took caller, the toolbox back handler, already guards on batch.length)
I've written a unit test covering it and would be happy to open a PR.
Activity
aloktomarr commentedon Jul 17, 2026
I can reproduce this on master. Root cause is in src/component/dataZoom/history.ts
pop() doesn't stop when only the origin snapshot remains it returns the origin as a restorable snapshot, so the toolbox "back"/zoom-reset dispatches one extra redundant dataZoom action(reset fires 3× after 2 zooms instead of 2×)
Proposed fix
pop() returns an empty snapshot when only the origin remains (its took caller, the toolbox back handler, already guards on batch.length)
I've written a unit test covering it and would be happy to open a PR.