Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderSectionContent is cutting text #383

Open
patrick-tresp opened this issue Jan 4, 2021 · 4 comments
Open

renderSectionContent is cutting text #383

patrick-tresp opened this issue Jan 4, 2021 · 4 comments

Comments

@patrick-tresp
Copy link

Hi there,

i have following method for renderSectionContent



const AccordionDetailsText = styled.Text`
  color: #4a4a4a;
  line-height: 20px;
  font-size: 14px;
  padding-bottom: 40px;
`

const renderSectionContent = (section: any) => {
    return (
      <AccordionDetailsText>
        {section.content}
      </AccordionDetailsText>
    )
  }

now everytime i collapse and open the react-native-collapsible/Accordion Section, Text is cut off and the overflow is hidden. Usually when opening it first time, it looks as expected. Closing and Opening each element leads to text cut off.

Has this happened to anyone also?

Cheers,

Patrick

@StIch0
Copy link

StIch0 commented Feb 25, 2021

@patrick-tresp

I fix this problem
renderContent={renderContent}

const renderContent = (content: MyItem): ReactElement => { return <Text style={styles.description}>{content.description}</Text>; };

description: { fontSize: 14, lineHeight: 20, paddingBottom: 8, paddingLeft: 12, paddingRight: 12, width: width - 60 - 24 // I add this line }

Check width of your content and width of accordion

@GTSConserve
Copy link

+1

@jacklj
Copy link

jacklj commented Feb 18, 2022

I've had a similar problem when modifying the content while using the Simulator + Fast Refresh. The issue is that the content container's size is only calculated on open, not when the content changes (related issue here #420). To fix it, I just collapse the accordion item and then open it again.

@jacklj
Copy link

jacklj commented Feb 18, 2022

Actually, that's probably not the same issue - in the OP's case, perhaps wrap the content component in a <View>, rather than it just being a <Text> component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants