Repository navigation
fix: cancel parent direct manipulations after press bubble completes (backport #23135) - #23364
Merged
agneszitte merged 2 commits intoJun 1, 2026
Merged
Conversation
…settles When a UIElement has ManipulationMode != System it has already declared "I'm handling this manipulation"; UIElement.OnPointerDown calls CancelDirectManipulations() to drop ancestor DMs. That call walks the DM list at the moment OnPointerDown runs — which during managed bubbling (ctx=OnManagedBubbling) is BEFORE higher ancestors like ScrollContentPresenter have had a chance to register their DMs via TryEnableDirectManipulation. The later-registered ancestor DM survives, tracks the pointer, and on the next move fires OnDirectManipulationStarted → CancelPointer, aborting the descendant's manipulation. On Skia Android, a pinch on a ManipulationMode=Scale Grid inside a scrollable ScrollViewer would fire ManipulationCompleted mid-gesture for exactly this reason. Track the first requester in InputManager.PointerManager.CancelDirectManipulations in a per-press field, reset in BeforePressTryRedirectToManipulations and consumed in AfterPressForDirectManipulation by re-running the cancel walk for that element. Because everything goes through InputManager.PointerManager.CancelDirectManipulations, this also covers end-user calls to UIElement.CancelDirectManipulations(): if app code cancels DMs from a custom PointerPressed handler before the bubble has reached the ScrollContentPresenter, the after-bubble redo catches the late registration. (cherry picked from commit 72706c0)
Add When_PinchOnScaleGrid_InsideScrollViewer_Then_ManipulationDoesNotCompletePrematurely. Reproduces the prior bug where a two-finger pinch on a ManipulationMode=Scale Grid inside a scrollable ScrollViewer would fire ManipulationCompleted mid-gesture because ScrollContentPresenter's DirectManipulation stole the second pointer. Two requirements to actually trigger the bug: * Content must be bigger than the viewport (600x600 Grid inside a 300x300 ScrollViewer) so the SCP DM doesn't abort immediately for lack of scrollable space. * The pressed element must be a child of the Scale grid (a 300x300 Rectangle pinned to the top-left) so the grid is an intermediate element in the bubble — the managed-bubbling path which ran the broken cancel timing. Fingers fan outward with asymmetric Y drift so the SCP DM's TranslateY threshold (15 px on touch) is crossed partway through, exactly matching the device-level repro. (cherry picked from commit f347111)
agneszitte
approved these changes
Jun 1, 2026
5 tasks
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.
GitHub Issue: closes https://github.com/unoplatform/kahua-private/issues/434
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️
This is an automatic backport of pull request #23135 done by [Mergify](https://mergify.com).