react-native-read-more icon indicating copy to clipboard operation
react-native-read-more copied to clipboard

"more" text alignment issue when we passed font size for more text

Open patidararvind opened this issue 2 years ago • 1 comments

Please could you give solution for that issue . Thanks Simulator Screen Shot - iPhone 13 - 2022-04-21 at 06 49 16

My code <ReadMore style={[styles.text, descText]} numberOfLines={numberOfLineDisplay} seeMoreText={'more'} seeLessText={'less'} seeMoreOverlapCount={0} allowFontScaling={false} // seeMoreStyle={styles.text} seeLessStyle={[styles.lessText, 'less']} seeMoreStyle={[styles.moreText, 'more']}> <ParsedText style={[styles.text, descriptionTxt]} parse={[ {pattern: tagRegex, renderText: renderTagText}, {pattern: urlRegex, renderText: renderURLText}, ]} childrenProps={{allowFontScaling: false}}> {descriptions} {/* {readMore ? descriptions : descriptions.substring(0, character)} */} </ParsedText> </ReadMore>

Style const styles = StyleSheet.create({ text: { fontSize: 16, paddingVertical: '2%', fontFamily: fonts.RRegular, color: colors.lightBlackColor, }, moreText: { color: 'gray', fontFamily: fonts.RRegular, fontSize: 12, }, lessText: { color: 'gray', fontSize: 12, }, });

patidararvind avatar Apr 21 '22 01:04 patidararvind

Hi @patidararvind , thanks for sharing this. The styles you are passing seem to have a text value in the array:

seeLessStyle={[styles.lessText, 'less']}
seeMoreStyle={[styles.moreText, 'more']}

Can you please remove it and test ?

Replace:

seeLessStyle={[styles.lessText, 'less']}
seeMoreStyle={[styles.moreText, 'more']}

with

seeLessStyle={styles.lessText}
seeMoreStyle={styles.moreText}

In any case I will try to reproduce this (maybe over the weekend, cannot guarantee a timeline) and post back here. If the above fix resolves the issue, then please respond in the thread. Thanks,

fawaz-ahmed avatar Apr 21 '22 04:04 fawaz-ahmed