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

Checkbox 在Popup 弹出层里面 选择样式无效 #687

Closed
scholar-ink opened this issue Dec 28, 2016 · 6 comments
Closed

Checkbox 在Popup 弹出层里面 选择样式无效 #687

scholar-ink opened this issue Dec 28, 2016 · 6 comments

Comments

@scholar-ink
Copy link

本地环境

  • antd-mobile 版本:最新版本 0.9.13
  • 浏览器 (或标明是 react-native) 及其版本:
  • 运行环境及其版本:

你做了什么?

在弹出层 show出来了 checkbox

Popup.show(
         <div className={ style.popup }>
             <div className={ style.screenBoxs }>
                 <div className={style.priceBox}>
                     <h1>价格</h1>
                     <List className={style.priceContent}>
                         <Slider range defaultValue={[0, 2000]} max={4000} onChange={this.priceRange} />
                         <span className={style.left}>0元</span><span className={style.right}>4000元以上</span>
                         <div style={{clear: 'both'}}></div>
                     </List>
                 </div>
                 <div className={style.priceBox}>
                     <h1>户型选择</h1>
                     <section className={style.checkBoxs}>
                         <ul className={style.checkBoxsUl}>
                             <Flex style={{ padding: 30 }}>
                                 <Flex.Item>{
                                     this.state.bed_room.map((i, index) => (
                                         <Checkbox>{i.title}</Checkbox>
                                     ))
                                 }
                                 </Flex.Item>
                             </Flex>
                         </ul>
                     </section>
                 </div>

你期待的结果是:

checkbox正常显示

实际上的结果:

checkbox选中样式无效

可重现的在线演示

@warmhug
Copy link
Contributor

warmhug commented Dec 28, 2016

测试没问题,检查下自己的使用方式

@lyraLe
Copy link

lyraLe commented Dec 30, 2016

这个组件之前正常,更新了最新版本后测试发现,onChange调用函数后函数执行了两遍,相当于点击了两次,表现结果是样式没变。checkbox包替换成原来的就好了

@warmhug
Copy link
Contributor

warmhug commented Dec 30, 2016

麻烦 Fork https://codepen.io/warmhug/pen/bwRPvx 给出可运行demo 。 onChange调用函数后函数执行了两遍 这个我没尝试出来。CheckboxItem 在 onChange 的时候会执行两遍 (#689 已修复)。

@se1phine
Copy link

se1phine commented Jan 3, 2017

@warmhug Popup 和 InputItem 联合使用出现问题,Switch也是。
demo:https://github.com/zhangda47/antd-mobile-popup-input

@warmhug
Copy link
Contributor

warmhug commented Jan 3, 2017

@zhangda47 把 InputItem 放到一个单独的组件内、比如叫 PopupInputItem ,在这个组件里处理 InputItem 的输入 value change . 另外官方 demo 也更新了。

@warmhug warmhug closed this as completed in c9eea28 Jan 3, 2017
warmhug added a commit that referenced this issue Jan 3, 2017
@lock
Copy link

lock bot commented May 28, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants