Skip to content

Commit

Permalink
Set isPressable for onPressIn/Out (#34944)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rozele authored and facebook-github-bot committed Oct 12, 2022
1 parent 4a786d6 commit f1f7824
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ const Text: React.AbstractComponent<

const isPressable =
(onPress != null ||
onPressIn != null ||
onPressOut != null ||
onLongPress != null ||
onStartShouldSetResponder != null) &&
_disabled !== true;
Expand Down

0 comments on commit f1f7824

Please sign in to comment.