Skip to content

fix(roam): respect globalPan mutex in mouseup/mousedown to keep zoom cursor - #21724

Open
waterWang wants to merge 1 commit into
apache:masterfrom
waterWang:fix/roam-cursor-globalpan-mutex
Open

fix(roam): respect globalPan mutex in mouseup/mousedown to keep zoom cursor#21724
waterWang wants to merge 1 commit into
apache:masterfrom
waterWang:fix/roam-cursor-globalpan-mutex

Conversation

@waterWang

Copy link
Copy Markdown

Problem

When the toolbox dataZoom button is active and the user clicks on the chart to zoom, the cursor changes to a default/gesture state after releasing the mouse. The expected behavior is that the cursor should remain as the zoom crosshair cursor while the dataZoom tool is active.

Root Cause

The RoamController._mousemoveHandler properly checks interactionMutex.isTaken(zr, 'globalPan') and defers to the BrushController when the dataZoom brush is active. However, _mousedownHandler and _mouseupHandler were not checking this mutex:

  • _mousedownHandler would set this._dragging = true even when the dataZoom brush owns the interaction
  • _mouseupHandler would reset the cursor to 'default' (via _decideCursorStyle) on mouse release, overriding the zoom crosshair cursor

Fix

Add the same interactionMutex.isTaken(zr, 'globalPan') guard to _mousedownHandler and _mouseupHandler, consistent with the existing check in _mousemoveHandler. This prevents the RoamController from interfering with the cursor when the BrushController (dataZoom) holds the globalPan mutex.

How to Reproduce

  1. Open the line-smooth chart example with toolbox dataZoom enabled
  2. Click the zoom button in the toolbox area
  3. Hover over the chart — cursor should be crosshair (zoom cursor) ✓
  4. Click and drag on the chart to select a zoom region
  5. Release the mouse — cursor should remain as crosshair, NOT change to default/gesture

Closes #21723

…cursor

When the toolbox dataZoom is active, the BrushController takes the
'globalPan' interaction mutex and the RoamController's mousemove handler
already defers to it. However the mousedown/mouseup handlers were not
checking the mutex, so releasing the mouse after a zoom drag reset the
cursor back to 'default' (via _decideCursorStyle) instead of keeping the
zoom crosshair cursor.

Add the same interactionMutex.isTaken(zr, 'globalPan') guard to
_mousedownHandler and _mouseupHandler so the RoamController never
overrides the cursor while the dataZoom brush is active.

close apache#21723
@echarts-bot

echarts-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

@waterWang waterWang changed the title fix(roam): respect globalPan mutex in mouseup/mousedown to keep zoom cursor [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] fix(roam): respect globalPan mutex in mouseup/mousedown to keep zoom cursor Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The zoom cursor in the toolbox area is incorrect

1 participant