Skip to content

Commit 33ff444

Browse files
Luna Weifacebook-github-bot
Luna Wei
authored andcommitted
Fix disabled behavior
Summary: Changelog: [General][Fixed] - Pass disabled prop to pressability config Reviewed By: kacieb Differential Revision: D26590399 fbshipit-source-id: dd4f8f25d1b243b2983cd4ffaadb5d3dc6f3ed3e
1 parent c4aa411 commit 33ff444

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Libraries/Text/Text.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ const Text: React.AbstractComponent<
4848
const [isHighlighted, setHighlighted] = useState(false);
4949

5050
const isPressable =
51-
onPress != null || onLongPress != null || onStartShouldSetResponder != null;
51+
(onPress != null ||
52+
onLongPress != null ||
53+
onStartShouldSetResponder != null) &&
54+
restProps.disabled !== true;
5255

5356
const initialized = useLazyInitialization(isPressable);
5457
const config = useMemo(

0 commit comments

Comments
 (0)