ant-design: DatePicker select month & year will close panel unexpectedly

Version

2.9.1

Environment

win10最新,chrome最新 react react-dom 15.5.4

Reproduction link

http://none

Steps to reproduce

import { Button, Form, Input, DatePicker } from 'antd';

const FormItem = Form.Item;
class CptSearch extends React.Component {
    createForm = () => {
        const { getFieldDecorator } = this.props.form;
        const formItemLayout = {
            labelCol: { span: 8 },
            wrapperCol: { span: 15 },
        };
        return [
            <FormItem {...formItemLayout} key="id" label="车号">
                {getFieldDecorator('id', { initialValue: '123456' })(
                    <Input />,
                )}
            </FormItem>,
            <FormItem {...formItemLayout} key="date" label="日期时间">
                {getFieldDecorator('date')(
                    <DatePicker />,
                )}
            </FormItem>,
            <FormItem key="submit" >
                <Button type="primary" htmlType="submit">Submit</Button>
            </FormItem>,
        ];
    }
    handleSearch = (e) => {
        console.log('submit');
    }
    render() {
        return (
            <Form layout="inline" onSubmit={this.handleSearch}>
                {this.createForm()}
            </Form>
        );
    }
}
const SearchForm = Form.create()(CptSearch);
export default SearchForm;

What is expected?

当点击日期选择器的年,面板变成日期选择; 当点击日期选择器的月,面板变成日期选择;

What is actually happening?

当点击日期选择器的年或月,面板直接退出。

目前2.8.3并没有此现象


不好意思,因为版本问题没有办法通过codepen实现,所以我直接创建的issue,十分抱歉

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

rm -rf node_modules && npm i

重现了:https://ant.design/components/date-picker-cn/

我刚才重新部署了网站。