镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[Bug] Zoom Reset Count Incorrect After Multiple Grids Zoom #21660

Open

Description

@RyanHuang-cloud

Version

6.1.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=grid-multiple

Steps to Reproduce

  1. Zoom in once on the upper trend chart.
  2. Zoom in once on the lower trend chart.
  3. You have now performed 2 zoom operations in total.
  4. 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.

Any additional comments?

No response

Activity

  1. added
    enThis issue is in English
    pendingWe are not sure about whether this is a bug/new feature.
    on Jun 23, 2026
  2. aloktomarr commented on Jul 17, 2026

    @aloktomarr

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions