Skip to content

Commit

Permalink
Fix text selecting in nested Text elements
Browse files Browse the repository at this point in the history
Based on this comment: necolas#1741 (comment)
  • Loading branch information
RichardLindhout authored Sep 17, 2020
1 parent 4a70300 commit 5da2996
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-native-web/src/exports/Text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const Text = forwardRef<TextProps, *>((props, forwardedRef) => {
const style = [
props.style,
numberOfLines != null && numberOfLines > 1 && { WebkitLineClamp: numberOfLines },
selectable === false && styles.notSelectable,
selectable === true ? styles.selectable : styles.notSelectable,
onPress && styles.pressable
];

Expand Down Expand Up @@ -212,6 +212,9 @@ const styles = StyleSheet.create({
notSelectable: {
userSelect: 'none'
},
selectable: {
userSelect: 'text'
},
pressable: {
cursor: 'pointer'
}
Expand Down

0 comments on commit 5da2996

Please sign in to comment.