From 2801b6f23c54587659e74bb5dadffa0489191fcc Mon Sep 17 00:00:00 2001 From: Gordon MacMaster Date: Thu, 7 May 2026 21:48:29 -0400 Subject: [PATCH 1/2] Create react-native-windows-4ad3ddaf-1358-4ff0-9971-38a7db68266c.json --- ...ative-windows-4ad3ddaf-1358-4ff0-9971-38a7db68266c.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-4ad3ddaf-1358-4ff0-9971-38a7db68266c.json diff --git a/change/react-native-windows-4ad3ddaf-1358-4ff0-9971-38a7db68266c.json b/change/react-native-windows-4ad3ddaf-1358-4ff0-9971-38a7db68266c.json new file mode 100644 index 00000000000..db40a35b9e0 --- /dev/null +++ b/change/react-native-windows-4ad3ddaf-1358-4ff0-9971-38a7db68266c.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix: use IsPrimary() for touch pointer isPrimary instead of hardcoded pointer ID check", + "packageName": "react-native-windows", + "email": "gordomacmaster@gmail.com", + "dependentChangeType": "patch" +} From 2813cacef3fd733cc076b81fd7dead702836a890 Mon Sep 17 00:00:00 2001 From: Gordon MacMaster <31481849+gmacmaster@users.noreply.github.com> Date: Thu, 7 May 2026 21:57:53 -0400 Subject: [PATCH 2/2] fix: use IsPrimary() for touch pointer isPrimary instead of hardcoded ID check (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit activeTouch.isPrimary was set via `pointerId == 1`, which only works for mouse (MOUSE_POINTER_ID == 1). Windows touch pointer IDs are OS-allocated and essentially never 1, so isPrimary was always false for touch input. This meant touch pointers never triggered onClick (gated behind isPrimary && button == 0) and reported incorrect isPrimary in PointerEvents sent to JS. Replace with pointerPoint.Properties().IsPrimary(), which reads the OS POINTER_FLAG_PRIMARY flag directly. This API is already used elsewhere in the codebase (SwitchComponentView, WindowsTextInputComponentView, Composition.Input). (The diagnostics are pre-existing clang noise from missing PCH/Windows headers — not related to this change.) --- .../Fabric/Composition/CompositionEventHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp index 161b82f74cd..3314bc495bb 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp @@ -1366,7 +1366,7 @@ void CompositionEventHandler::onPointerPressed( UpdateActiveTouch(activeTouch, ptScaled, ptLocal); - activeTouch.isPrimary = pointerId == 1; + activeTouch.isPrimary = pointerPoint.Properties().IsPrimary(); // Map the Windows pointer ID to a small identifier (0–19) safe for use as a JS array index. // Windows touch IDs can be arbitrarily large (e.g. 2233), which causes React Native to warn // and corrupts touch state, leaving Pressables stuck after a scroll.