You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Native Base后React Native Select组件仅点击箭头可触发的问题求助

Native Base Select组件点击触发异常问题

近期升级Native Base后,在React Native应用中使用Select组件时遇到问题:只有点击下拉箭头才能触发下拉菜单,点击组件的其他区域均无法触发下拉。

实现代码

let testTypeOptions = [
  { value: 6, label: 'Maternity Test' },
  { value: 18, label: 'Paternity Test' },
];

<Container style={cocStyle.container}>
  <View style={cocStyle.formContainer}>
  <Select
    selectedValue={examDetail?.testType}
    onValueChange={value => handleChange('testType', value)}>
    {testTypeOptions.map((test, index) => (
      <Select.Item key={index} {...test} />
    ))}
  </Select>
  </View>
</Container>

const cocStyle = StyleSheet.create({
  container: { paddingTop: 10, width: '60%', alignSelf: 'center' },
  formContainer: {
    ...formStyles.formWrapper,
    width: '100%',
    flexWrap: 'wrap',
    flexDirection: 'row',
  },
});

组件显示效果

组件显示效果截图

内容的提问来源于stack exchange,提问作者chewie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 23:20:17