Skip to content

Commit

Permalink
Fix disabled behavior
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[General][Fixed] - Pass disabled prop to pressability config

Reviewed By: kacieb

Differential Revision: D26590399

fbshipit-source-id: dd4f8f25d1b243b2983cd4ffaadb5d3dc6f3ed3e
  • Loading branch information
Luna Wei authored and facebook-github-bot committed Feb 23, 2021
1 parent c4aa411 commit 33ff444
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ const Text: React.AbstractComponent<
const [isHighlighted, setHighlighted] = useState(false);

const isPressable =
onPress != null || onLongPress != null || onStartShouldSetResponder != null;
(onPress != null ||
onLongPress != null ||
onStartShouldSetResponder != null) &&
restProps.disabled !== true;

const initialized = useLazyInitialization(isPressable);
const config = useMemo(
Expand Down

0 comments on commit 33ff444

Please sign in to comment.