Repository navigation
Conversation
…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
|
Thanks for your contribution! 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief Information
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
domBelongToZrmarker 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
appendToplaces 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
HandlerDomProxycapture fields and__togglePointerCapturemethod 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
Misc
Security Checking
The runtime change adds event handling only. The manual fixture uses fixed, locally authored HTML content.
ZRender Changes
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.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
Other information
AI tooling disclosure: OpenAI Codex was used to develop the implementation, tests and this description. The commit includes a
Generated-by: OpenAI Codexprovenance trailer. No claim of independent human code review is made here.