[0.84] fix: cancel active touches in onPointerCaptureLost to prevent zombie touch state#16087
Open
gmacmaster wants to merge 2 commits intomicrosoft:0.84-stablefrom
Conversation
…touch state (microsoft#16086) * fix: cancel active touches in onPointerCaptureLost to prevent zombie touch state (#2) * fix: cancel active touches in onPointerCaptureLost to prevent zombie touch state When the OS reclaims pointer capture mid-gesture (system back swipe, Alt+Tab, another window coming foreground), onPointerCaptureLost fired but never removed entries from m_activeTouches or dispatched a touchcancel to React Native JS. The result was a zombie active touch — RN JS believed a finger was still down, leaving Pressables and TouchableOpacities stuck in a pressed state until the next touch happened to reuse the same pointer ID and trigger the stale-touch cleanup in onPointerPressed. Fix: for each captured pointer in the lost-capture set, copy and erase the m_activeTouches entry before calling DispatchSynthesizedTouchCancelForActiveTouch, mirroring the pattern already used in onPointerPressed and onPointerReleased. The erase-before-dispatch ordering is required because DispatchSynthesizedTouchCancelForActiveTouch iterates m_activeTouches internally. * match the m_pointerCapturingComponentTag != -1 check already used in CapturePointer * Create react-native-windows-f47bdf2a-0807-483f-b63e-3c2c086bee92.json
Contributor
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
Performance Test ResultsBranch: ✅ Passed161 scenario(s) across 28 suite(s) — no regressionsSectionList
FlatList
TouchableOpacity
ScrollView
TouchableHighlight
Pressable
Modal
Image
ActivityIndicator
Switch
Button
TextInput
View
Text
SectionList.native-perf-test.ts
FlatList.native-perf-test.ts
TouchableHighlight.native-perf-test.ts
TouchableOpacity.native-perf-test.ts
Pressable.native-perf-test.ts
ScrollView.native-perf-test.ts
ActivityIndicator.native-perf-test.ts
TextInput.native-perf-test.ts
Switch.native-perf-test.ts
Button.native-perf-test.ts
Modal.native-perf-test.ts
Image.native-perf-test.ts
View.native-perf-test.ts
Text.native-perf-test.ts
|
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.
Port #16086 to 0.84
Microsoft Reviewers: Open in CodeFlow