react-native-expandable-section-flatlist icon indicating copy to clipboard operation
react-native-expandable-section-flatlist copied to clipboard

How to close first item when i open second item in Exapandable flatlist?

Open shivaraj-profecia opened this issue 6 years ago • 2 comments

shivaraj-profecia avatar Jun 07 '18 10:06 shivaraj-profecia

@shivaraj-profecia The method setSectionState can be manually set to turn off the group, you can call in the group header click on the headerOnPress to invoke this method to achieve the requirements

I'm sorry to see issue now.

cuiyueshuai avatar Jun 14 '18 00:06 cuiyueshuai

i tried it like this but not working

by default openCheck is false

setSectionState = (i, s) =>{console.log("index "+i+" state "+s); s ? this.setState({ openCheck: true }): this.setState({ openCheck: false}) }; 

 <ExpanableList
        style={{marginTop: 60,}}
          dataSource={this.state.listDataSource}
          headerKey="category"
          memberKey="food_items"
          renderRow={this._renderRow}
          renderSectionHeaderX={this._renderSection}
          openOptions={[this.state.ind,]}
          headerOnPress= {this.setSectionState}
          isOpen={this.state.openCheck}
        />

@cuiyueshuai please suggest how to do it

raikk avatar May 10 '19 10:05 raikk