ListView within collapsible
Hey how's it going? Love the library but I'm having a little trouble putting a ListView within a collapsible component.
Whenever I put a ListView into a Collapsible, it seems to lose the screen border, and renders the rest of the list off page with no scrolling (But collapsing works fine!). If I remove Collapsible, it flex's to the edge of screen and allows scroll.
If I give the ListView a static height, it renders and scrolls fine, but needs to be precise, and feels wrong. I think something about collapsible is losing the screen dimensions? I'm sure I'm missing a React trick somewhere, I've just started playing around with this.
So essentially: Parent Class:
renderPage: function(){
return (
<View style={styles.main} >
<TouchableOpacity onPress={this.toggleRoster} >
<KkToolbar title={"Roster"} />
</TouchableOpacity>
<Collapsible collapsed={!this.state.rosterToggle} style={styles.roster}>
<Child id={this.props.id} navigator={this.props.navigator} />
</Collapsible>
<KkToolbar title={"Team Matches"}/>
</View>
);
},
Child Class:
renderChild: function(){
return (
<View style={styles.main} >
<TouchableOpacity onPress={this.grabTeamHistory.bind(this,this.state.team_id)}>
<KkToolbar title={this.state.team} style={[this.props.style]} />
</TouchableOpacity>
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderPlayer}
style={[styles.roster]} />
</View>
);
},
and, the styles:
main: {
flex: 1,
flexDirection: 'column',
//alignItems: 'center',
backgroundColor: '#000',
},
roster: {
flexDirection: 'column',
flex:1,
// height: windowSize.height-269,
},
Hi, it seems like a bug. Collapsible.js ..... start(event => this.setState({ animating: true }));
fix: start(event => this.setState({ animating: false }));
Cheers
It is fixed on github, but not in latest npm package
Released in 0.5.6.
thank you!