React-native-collapsible: Can't be used with any animated components

Created on 20 Dec 2017  路  8Comments  路  Source: oblador/react-native-collapsible

like react-native-zoom-image

I put my component in Collapsible, and it will been disappears when my animated components is trigger

bug help wanted

Most helpful comment

I fixed it with this code
at Collapsible.js line 157

 const { collapsed } = this.props;
    const { height, contentHeight, measuring, measured } = this.state;
    const hasKnownHeight = !measuring && (measured || collapsed);
    const style = hasKnownHeight && {
      overflow: 'scroll',  //here!
      height: height,
    };
    const contentStyle = {};

then the problem has been solved

All 8 comments

Could you create a small example on https://snack.expo.io that replicates this behaviour?

I fixed it with this code
at Collapsible.js line 157

 const { collapsed } = this.props;
    const { height, contentHeight, measuring, measured } = this.state;
    const hasKnownHeight = !measuring && (measured || collapsed);
    const style = hasKnownHeight && {
      overflow: 'scroll',  //here!
      height: height,
    };
    const contentStyle = {};

then the problem has been solved

I'd still really like to see how you are using this in your use case. Can you also create a PR so I can test the changes?

I had a problem that the collapsible was being closed and showing no content, and when I tap again the content was shown. I don't know why, but this fix my problem too.

Thanks!

Closing this as inactive. Releasing a new version today that should deal better with managing the content of views. Would love for you to try it and see if the problem still persists.

@iRoachie this solution also fixes my use case. here's a gif of whats occurs when using the library as-is. replacing overflow: 'hidden' with overflow: 'scroll' solves it for me. I think there's potentially more to this though, as this occurs when I'm using tcomb-form-native within the accordion

capture

I'm using Accordion with react-native-swipeout and had the same problem where items disappear when I try to swipe to show the hidden button. I tried @brycepavey 's solution and it worked! Thank you for sharing the solution @brycepavey !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SaberRiryi picture SaberRiryi  路  3Comments

pkantsedalov picture pkantsedalov  路  5Comments

sohanpatil44 picture sohanpatil44  路  3Comments

abdulkhaliquem9 picture abdulkhaliquem9  路  5Comments

ishaqashraf picture ishaqashraf  路  6Comments