Skip to content

fix(tooltip): stop dragging after release over enterable content - #21826

Draft
diysimon wants to merge 1 commit into
apache:masterfrom
diysimon:fix-20817
Draft

diysimon wants to merge 1 commit into
apache:masterfrom
diysimon:fix-20817

Conversation

@diysimon

@diysimon diysimon commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Brief Information

  • bug fixing
  • new feature
  • others

What does this PR do?

Stops renderer dragging when the mouse is released over enterable HTML tooltip content.

Fixed issues

Closes #20817.

Details

Before: What was the problem?

Start panning a graph on the canvas, move onto an enterable tooltip, release the mouse, and move back onto the canvas: the graph continues to pan. The tooltip's domBelongToZr marker causes zrender's document listener to skip the release, leaving both the roam controller and document capture active.

After: How does it behave after the fixing?

For a press originating in the renderer, tooltip releases clear capture and deliver one mouseup. Ordinary tooltip interactions remain available, without synthesizing clicks or preventing native defaults.

When appendTo places the tooltip inside the renderer event root, normal bubbling gets the first chance to handle the release. A zero-delay fallback handles a child that stops propagation. Native mouseup, a new renderer mousedown, and tooltip disposal cancel that fallback.

No public API or zrender repository change is introduced. The implementation uses the existing internal HandlerDomProxy capture fields and __togglePointerCapture method in zrender 6.1.0. A proxy without that method is skipped; arbitrary custom-proxy capture semantics are not implemented. This internal coupling and the deferred nested-release path warrant review.

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.

The runtime change adds event handling only. The manual fixture uses fixed, locally authored HTML content.

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

  • test/ut/spec/component/tooltip/enterable.test.ts: 28 DOM regressions covering canvas/SVG, default/external/nested appendTo, mouse/pointer releases, stopped bubbling, repeated drags, release before capture, outside release, non-enterable content, cancellation and missing custom-proxy methods.
  • test/tooltip-enterable-roam.html: interactive reproduction and control checks.

Validation on macOS against master 34f4d927eafe251f26f63afd3aeefa30f2feba30:

  • npm test -- --runInBand --coverage=false: 27 suites, 222 tests passed.
  • npm run checktype, npm run lint:nocache, npm run checkheader, npm run build:lib, npm run test:dts:fast: passed.
  • Fresh Rollup bundle and Chrome browser automation: 16 original before/after configurations and 8 nested first-fix/final configurations, three drag cycles per configuration; button, link and text-selection behavior checked. Drag releases did not add renderer clicks.
  • Baseline regression check from development: the same 28 tests on unmodified master produced 16 failures and 12 passes; all 28 pass with this change.

Limitations: native Windows Edge, Firefox, Safari and touch/pen hardware were not tested. Pointer routing has synthetic DOM coverage. The nested stopped-propagation fallback completes in a later task. Native control-click bubbling when a tooltip is deliberately placed inside the renderer remains unchanged; this is not blanket suppression of renderer clicks. The full visual suite and full release matrix were not run.

Merging options

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

Other information

AI tooling disclosure: OpenAI Codex was used to develop the implementation, tests and this description. The commit includes a Generated-by: OpenAI Codex provenance trailer. No claim of independent human code review is made here.

…lose apache#20817

Bridge tooltip mouse/pointer releases to the renderer and clear its capture
state. Allow native bubbling first for nested appendTo targets, with a
cancellable deferred fallback when a tooltip child stops propagation.

Add DOM event regressions and a manual browser fixture.

Generated-by: OpenAI Codex
@echarts-bot

echarts-bot Bot commented Nov 7, 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] Continuosly dragging the graph series after moving mouse over an enterable tooltip

1 participant