From f1f78242039438241a905eb43b37c57b73e03335 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Wed, 12 Oct 2022 09:35:43 -0700 Subject: [PATCH] Set isPressable for onPressIn/Out (#34944) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/34944 In react-native-windows, the ability to detect a press event on a virtual span is dependent on setting a native only `isPressable` prop. This modifies the Text component to include `onPressIn` and `onPressOut`. As a side-effect, this will also lazily initialize the pressability config when `onPressIn` or `onPressOut` only is set. Changelog: [General][Fixed] - Pressability for text with only `onPressIn` / `onPressOut` props Reviewed By: yungsters Differential Revision: D40264432 fbshipit-source-id: 583b210127d8f020ad98030d4a5381c302e88d2a --- Libraries/Text/Text.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index ac427bf8c736ae..0f9eb500bb919a 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -81,6 +81,8 @@ const Text: React.AbstractComponent< const isPressable = (onPress != null || + onPressIn != null || + onPressOut != null || onLongPress != null || onStartShouldSetResponder != null) && _disabled !== true;