Skip to content

Commit f1f7824

Browse files
rozelefacebook-github-bot
authored andcommitted
Set isPressable for onPressIn/Out (#34944)
Summary: Pull Request resolved: #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
1 parent 4a786d6 commit f1f7824

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Libraries/Text/Text.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ const Text: React.AbstractComponent<
8181

8282
const isPressable =
8383
(onPress != null ||
84+
onPressIn != null ||
85+
onPressOut != null ||
8486
onLongPress != null ||
8587
onStartShouldSetResponder != null) &&
8688
_disabled !== true;

0 commit comments

Comments
 (0)