taskrabbit / react-native-parsed-text

Parse text and make them into multiple React Native Text elements
MIT License
1.21k stars 163 forks source link

selectable works on iOS but not on Android. #99

Open anilios opened 3 years ago

anilios commented 3 years ago

When setting selectable = {true} for ParsedText, the copy option appears just fine on iOS on long press. But on android, it does not appear. I was able to see the copy option once in a while on Android also but it is 99% of the time not working.

` <ParsedText selectable style={styles.textStyle} parse={[ {type: 'url', style: styles.userNameStyle, onPress: onLink }, { pattern: /userMentionStart-(.?)-userMentionEnd/, style: styles.userNameStyle, onPress: (id, matchIndex) => {onUser(parseUserId(id));}, renderText: (matchingString, matches) => mapUser(parseUserId(matchingString)) }, { pattern: /hashtagMentionStart-(.?)-hashtagMentionEnd/, style: styles.hashTag, onPress: (id, matchIndex) => {onHashtag(parseHashtagId(id));}, renderText: (matchingString, matches) => mapHashtag(parseHashtagId(matchingString)) }, {pattern: /#(\w+)/, style: styles.hashTag}, ]} childrenProps={{ allowFontScaling: false }}

{ item.postText } `

fredmanxu commented 2 years ago

When setting selectable = {true} for ParsedText, the copy option appears just fine on iOS on long press. But on android, it does not appear. I was able to see the copy option once in a while on Android also but it is 99% of the time not working.

<ParsedText selectable style={styles.textStyle} parse={[ {type: 'url', style: styles.userNameStyle, onPress: onLink }, { pattern: /userMentionStart-(.*?)-userMentionEnd/, style: styles.userNameStyle, onPress: (id, matchIndex) => {onUser(parseUserId(id));}, renderText: (matchingString, matches) => mapUser(parseUserId(matchingString)) }, { pattern: /hashtagMentionStart-(.*?)-hashtagMentionEnd/, style: styles.hashTag, onPress: (id, matchIndex) => {onHashtag(parseHashtagId(id));}, renderText: (matchingString, matches) => mapHashtag(parseHashtagId(matchingString)) }, {pattern: /#(\w+)/, style: styles.hashTag}, ]} childrenProps={{ allowFontScaling: false }} > { item.postText } </ParsedText>

the same problem, have you solved it?

khudratov commented 2 years ago

same problem