ant-design / ant-design-mobile-rn

Ant Design for React Native
https://rn.mobile.ant.design/
MIT License
3.08k stars 611 forks source link

DatePicker 在 onValueChange 方法里调用 setState 滑动日期 回弹 初始值 #550

Closed fightingljm closed 5 years ago

fightingljm commented 5 years ago

Reproduction link

https://github.com/ant-design/ant-design-mobile-rn

Steps to reproduce

<DatePicker
                            title={`${this.state.test}`}
                            mode={'datetime'}
                            itemStyle={{ fontSize: 18 }}
                            onChange={v => {
                                this.setState({
                                    time: v,
                                })
                            }}
                            onValueChange={(vals)=>{
                                this.setState({
                                    test: vals
                                })
                            }}
                        >
                            <CustomItem />
                        </DatePicker>

What is expected?

DatePicker 在 onValueChange 方法里调用 setState 可以正常滑动选择日期

What is actually happening?

DatePicker 在 onValueChange 方法里调用 setState 滑动日期 回弹 初始值

Environment Info
antd 3.1.5
React react-native
System OSX
Browser -
buffge commented 5 years ago

https://github.com/ant-design/ant-design-mobile-rn/issues/496

fightingljm commented 5 years ago

496

@buffge image

image

It's didn't work

wangfpp commented 4 years ago

这个问题我也遇到了