我正在使用react-native-multiple-select
及其工作方式,但是,我想做的是之后我提交所有选择的项目,而不是在我正在选择。
<MultiSelect
hideTags
items={this.filter_pref}
uniqueKey="id"
ref={(component) => { this.multiSelect = component }}
onSelectedItemsChange={this.onSelectedItemsChange}
selectedItems={selectedItems}
selectText="Zgjedh "
searchInputPlaceholderText="Kerko filterat..."
// onChangeInput={(text) => console.log(text)}
altFontFamily="ProximaNova-Light"
tagRemoveIconColor="#CCC"
tagBorderColor="#CCC"
tagTextColor="#CCC"
selectedItemTextColor="#CCC"
selectedItemIconColor="#CCC"
itemTextColor="#000"
displayKey="name"
searchInputStyle={{ color: '#CCC' }}
submitButtonColor="#CCC"
submitButtonText="Zgjedh"
/>
还有我设置值的函数:
onSelectedItemsChange = selectedItems => {
this.setState({ selectedItems });
}