[0.84] fix: cancel zombie touch state on ScrollView pointer capture loss#16106
Open
gmacmaster wants to merge 2 commits intomicrosoft:0.84-stablefrom
Open
[0.84] fix: cancel zombie touch state on ScrollView pointer capture loss#16106gmacmaster wants to merge 2 commits intomicrosoft:0.84-stablefrom
gmacmaster wants to merge 2 commits intomicrosoft:0.84-stablefrom
Conversation
When a touch-screen user scrolls a ScrollView, the OS redirects the
pointer to the InteractionTracker via TryRedirectForManipulation and
fires PointerCaptureLost. The existing handler only cleaned up touches
when JS-level CapturePointer was active (m_pointerCapturingComponentTag
!= -1), which ScrollView never uses. This left a zombie entry in
m_activeTouches that kept Pressables visually stuck in a pressed state
and caused subsequent taps to replay events against the original target.
Three changes:
1. Extend onPointerCaptureLost to unconditionally cancel the active
touch for the specific pointer that lost capture, regardless of
whether JS-level CapturePointer was ever issued.
2. Remove the always-true fallback in IsPointerWithinInitialTree that
walked from activeTouch.touch.target (always the initial view) back
to initialTag, returning true on iteration 1 and bypassing the
correct W3C hit-test check. This caused onClick to fire even when
the pointer was released over a different target.
3. Scope per-pointer event dispatch in DispatchTouchEvent to only the
pointer that actually changed, instead of iterating every entry in
m_activeTouches. The old loop fired onPointerDown/Move/Up/Cancel
for all active touches, producing duplicated events in multi-touch
scenarios and replaying events on zombie targets.
Contributor
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
…hing the base branch.
Contributor
Author
|
I see it failed with vnext\Microsoft.ReactNative\Fabric\Composition\CompositionEventHandler.cpp(1756,41): Error C2039: 'onAuxClick': is not a member of 'facebook::react::TouchEventEmitter' Before my cherry pick, it was commented out. Reverted to being commented out |
Contributor
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
cherry #16100
Microsoft Reviewers: Open in CodeFlow