From c4e88b7285024490db7a00e21b99aa18630179c2 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Fri, 24 Oct 2025 03:03:03 -0700 Subject: [PATCH] Increase the maximum number of pointers tracked at the same time on iOS to 17 (#54248) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54248 Changelog: [IOS][FIXED] - Raised the maximum number of pointers tracked at the same time to 17 The current pool of pointer ids that can be used at the same time has the size of 11, while the maximum supported by some of the devices is 17 - https://developer.apple.com/forums/thread/17606. To reproduce this problem use the iPad pro and place more than 11 pointers on the screen - the app becomes unresponsive due to [an infinite loop](https://github.com/facebook/react-native/blob/d93d32547bfadba731999ea251ca5e1d6c6c8912/packages/react-native/React/Fabric/Utils/RCTIdentifierPool.h#L22). Reviewed By: cipolleschi Differential Revision: D85345975 fbshipit-source-id: df6ba61f933406e7dc4e31382b35f002611fa433 --- packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm | 2 +- packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm b/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm index 1dce2068262..d752d6ae56b 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm +++ b/packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm @@ -437,7 +437,7 @@ struct PointerHasher { * We hold the view weakly to prevent a retain cycle. */ __weak UIView *_rootComponentView; - RCTIdentifierPool<11> _identifierPool; + RCTIdentifierPool<17> _identifierPool; UIHoverGestureRecognizer *_mouseHoverRecognizer API_AVAILABLE(ios(13.0)); UIHoverGestureRecognizer *_penHoverRecognizer API_AVAILABLE(ios(13.0)); diff --git a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm index a793251fc62..610e4b3d18b 100644 --- a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm +++ b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm @@ -137,7 +137,7 @@ struct PointerHasher { * We hold the view weakly to prevent a retain cycle. */ __weak UIView *_rootComponentView; - RCTIdentifierPool<11> _identifierPool; + RCTIdentifierPool<17> _identifierPool; RCTSurfacePointerHandler *_pointerHandler; }