fawaz-ahmed / react-native-read-more

React native library to show text in a condensed way and expand when needed. Drop in replacement for Text component and highly customizable. Can be used with expo or native cli for react native.
https://www.npmjs.com/package/@fawazahmed/react-native-read-more
MIT License
275 stars 37 forks source link

Show more always shown #17

Closed IbrahimCanKALYA closed 3 years ago

IbrahimCanKALYA commented 3 years ago

on ios everything seems fine but on android; always show more button showing..

fawaz-ahmed commented 3 years ago

@IbrahimCanKALYA can you share some more info like screenshot and some piece of code on how you're using it ? This can help me fix.

IbrahimCanKALYA commented 3 years ago

image

image


 <ReadMore
      style={{...styles.defaultTextStyle, ...style}}
      numberOfLines={numberOfLines}
      allowFontScaling={false}
      seeMoreText="more"
      seeLessText="less"
      seeMoreStyle={{...style, ...styles.seeMoreLessStyle, ...seeMoreStyle}}
      seeLessStyle={{...style, ...styles.seeMoreLessStyle, ...seeLessStyle}}
      {...props}>
      {renderText()}
    </ReadMore>

i'm facing with this issue on samsung s20

IbrahimCanKALYA commented 3 years ago

i find the problem where he is. when i set allowFontScaling={false} this problem accoures but i need to set this parameter

i fixed this issue via this usage:


customTextComponent={(props: TextProps) => (
        <Text {...props} allowFontScaling={false} />
      )}
fawaz-ahmed commented 3 years ago

@IbrahimCanKALYA thanks for providing more info. I've fixed this issue. Now just passing allowFontScaling={false} should be sufficient and you can remove customTextComponent. Upgrade to version ^1.1.4