Skip to content

[0.84] fix: cancel zombie touch state on ScrollView pointer capture loss#16106

Open
gmacmaster wants to merge 2 commits intomicrosoft:0.84-stablefrom
Virtual-Fulfillment-Technologies-Inc:vendora/cherry-16100
Open

[0.84] fix: cancel zombie touch state on ScrollView pointer capture loss#16106
gmacmaster wants to merge 2 commits intomicrosoft:0.84-stablefrom
Virtual-Fulfillment-Technologies-Inc:vendora/cherry-16100

Conversation

@gmacmaster
Copy link
Copy Markdown
Contributor

@gmacmaster gmacmaster commented May 9, 2026

cherry #16100

Microsoft Reviewers: Open in CodeFlow

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.
@gmacmaster gmacmaster requested a review from a team as a code owner May 9, 2026 02:47
@acoates-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@gmacmaster
Copy link
Copy Markdown
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

@acoates-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants