toystars / react-native-multiple-select

Simple multi-select component for react-native
MIT License
565 stars 313 forks source link

How to Show two components #69

Open darioajr opened 6 years ago

darioajr commented 6 years ago

How to show two components, one below the other?

toystars commented 6 years ago

@darioajr I am not sure I understand what you mean

Rana-Muhammad-Amir commented 6 years ago

@toystars i want to use two picker component at same screen...... but when i use it the arrayof first multiSelect override by the second multiselect array....... like first picker code is

<MultiSelect hideTags items={this.state.dataSource1} uniqueKey="id" ref={(component) => { this.multiSelect = component }} onSelectedItemsChange={this.onSelectedItemsChange1} selectedItems={this.state.selectedItems} selectText="Select Building" searchInputPlaceholderText="Search Items..." onChangeInput={ (text)=> console.log(text)} altFontFamily="ProximaNova-Light" tagRemoveIconColor="#45B3E8" tagBorderColor="#45B3E8" tagTextColor="#45B3E8" selectedItemTextColor="#45B3E8" selectedItemIconColor="#45B3E8" itemTextColor="black" displayKey="name" searchInputStyle={{ color: '#45B3E8' }} submitButtonColor="#45B3E8" submitButtonText="Submit" />

second picker code is...... <MultiSelect hideTags items={this.state.dataSource2} uniqueKey="id" ref={(component) => { this.multiSelect = component }} onSelectedItemsChange={this.onSelectedItemsChange2} selectedItems={this.state.selectedItems2} selectText="Select Features" searchInputPlaceholderText="Search Features..." onChangeInput={ (text)=> console.log(text)} altFontFamily="ProximaNova-Light" tagRemoveIconColor="#45B3E8" tagBorderColor="#45B3E8" tagTextColor="#45B3E8" selectedItemTextColor="#45B3E8" selectedItemIconColor="#45B3E8" itemTextColor="black" displayKey="name" searchInputStyle={{ color: '#45B3E8' }} submitButtonColor="#45B3E8" submitButtonText="Submit" />

please point out where i have to change ......

maac4422 commented 6 years ago

Try change de "ref" props for this. ref={component => this.multiSelect = component }