【发布时间】:2019-06-06 08:33:47
【问题描述】:
我正在尝试在模式中使用 Searchable Dropdown 来响应本机。如果我“单独”使用它(我的意思是在模式之外)它工作正常。但是如果我把它放在一个模式中,它的属性 onItemSelect 似乎没有工作(它不允许我点击任何东西)
<Modal isVisible={this.state.isBuildingModalVisible}>
<SearchableDropdown
onItemSelect={item => {
this.setState({ building_id: item.id });
}}
containerStyle={{ ...}}
textInputStyle={{
...
}}
itemStyle={{
...
}}
itemTextStyle={{
color: "white",
fontSize: (15 / 411.42) * screen
}}
itemsContainerStyle={{ maxHeight: 140 }}
items={this.state.dataSource}
placeholder="Choose School"
placeholderTextColor="white"
underlineColorAndroid="transparent"
/>
<View
style={{
alignItems: "center",
justifyContent: "center",
flexDirection: "row"
}}
>
<TouchableOpacity
style={styles.button}
onPress={this.toggleBuildingModal}
>
<Text style={{ color: "white" }}>Cancel</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() => this.submitpassword()}
>
<Text style={{ color: "white" }}>Execute</Text>
</TouchableOpacity>
</View>
</Modal>
【问题讨论】:
标签: react-native modal-dialog dropdown searchable