Skip to content

fix(brush): honor configured multiple mode in toolbox - #21764

Open
jakezwang wants to merge 1 commit into
apache:masterfrom
jakezwang:fix-21346
Open

jakezwang wants to merge 1 commit into
apache:masterfrom
jakezwang:fix-21346

Conversation

@jakezwang

Copy link
Copy Markdown

Brief Information

  • bug fixing
  • new feature
  • others

What does this PR do?

Honor brush.brushMode: 'multiple' when first activating a toolbox brush tool.

Fixed issues

Fixes #21346.

Details

Before: What was the problem?

The toolbox only reads brushModel.brushOption.brushMode, which is unset before the first brush action. It falls back to single even when the brush component is configured for multiple selections; the Keep selection icon also starts in the wrong state.

After: How does it behave after the fixing?

Fall back to the component's configured brushMode before the default single. Explicit mode changes through Keep selection still take precedence.

Document Info

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

  • This PR depends on ZRender changes.

Related test cases or examples to use the new APIs

  • Added toolbox unit tests for configured multiple mode, toggling Keep selection, and the default single mode. The first two fail before the fix.
  • Added a deterministic interaction case at the bottom of test/brush3.html.
  • Verified real Chromium pointer drags retain two selections initially; after turning off Keep selection, a new drag leaves one selection. No page errors.
  • TZ=UTC npm test -- --runInBand --coverage=false: 27 suites / 197 tests passed.
  • npm run build:lib, npm run checktype, npm run lint, and node build/build.js --type all: passed. Generated build output is not included.

Merging options

  • Please squash the commits into a single one when merging.

Other information

Implementation and validation were performed primarily with OpenAI Codex.

…1346

Signed-off-by: Jake Wang <jakezwang@users.noreply.github.com>
@echarts-bot

echarts-bot Bot commented Sep 26, 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.

This branch has not been deployed

No deployments
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] brushMode: 'multiple' is not working

1 participant