Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckboxItem初始未选中的不能切换选中状态 #784

Closed
rendongsc opened this issue Feb 8, 2017 · 2 comments
Closed

CheckboxItem初始未选中的不能切换选中状态 #784

rendongsc opened this issue Feb 8, 2017 · 2 comments
Assignees
Labels

Comments

@rendongsc
Copy link

rendongsc commented Feb 8, 2017

本地环境

  • antd-mobile 版本:react-native
  • 浏览器 (或标明是 react-native) 及其版本:1.0.0-beta.2
  • 运行环境及其版本:android 4.4

问题描述

  • 官方的BasicCheckboxExample可以重现问题( 物料铺设)。
  • 如果初始状态checked=true,是OK的。
  • onChange的event.target.checked始终为true。
@paranoidjk
Copy link
Contributor

@rendongsc 是 RN 的组件有问题吗? 贴一个简单的示例代码吧,你描述的太混乱了没法帮你

@rendongsc
Copy link
Author

rendongsc commented Feb 8, 2017

@paranoidjk 写的稍微多了些,简化一下:
1、RN的CheckboxItem组件,版本:1.0.0-beta.2
2、可重现问题的示例:官方demo(ant-design-mobile\components\checkbox\demo)

  <List style={{marginTop: 12}}>
          <Text style={{marginTop: 12}}>表单多选项,普通列表中多选项</Text>
          <CheckboxItem
            checked={this.state.checkboxItem1}
            onChange={(event) => { this.setState({ checkboxItem1: event.target.checked }); }}
          >
            签约
          </CheckboxItem>
          <CheckboxItem>物料铺设</CheckboxItem>
          <CheckboxItem disabled>机具维护(不能选)</CheckboxItem>
          <CheckboxItem disabled checked>产品问题解决(必选)</CheckboxItem>
        </List>

CheckboxItem(物料铺设)切换不了选中状态!

@rendongsc rendongsc changed the title CheckboxItem初始未选中的不能选择! CheckboxItem初始未选中的不能切换选中状态 Feb 8, 2017
@paranoidjk paranoidjk self-assigned this Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants