question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DatePicker select month & year will close panel unexpectedly

See original GitHub issue

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,十分抱歉

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
benjycuicommented, Apr 20, 2017

rm -rf node_modules && npm i

1reaction
afc163commented, Apr 19, 2017

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

我刚才重新部署了网站。

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery UI datepicker not opening to previously selected date if ...
Just add this line to your code $("#monthDate1").datepicker('option', 'defaultDate', new Date(year, month, 1)); in your $("#monthDate1").focus function.
Read more >
Datepicker Widget - jQuery UI API Documentation
Called when the datepicker moves to a new month and/or year. The function receives the selected year, month (1-12), and the datepicker instance...
Read more >
Designing The Perfect Date And Time Picker
The interface takes care of this issue: At any point of time, the date picker displays the view with two months at a...
Read more >
Date picker component — Vuetify
v-date-picker is a fully featured date selection component that lets users ... with reactive prop they can update the model even after clicking...
Read more >
Date Picker | Components | Vaadin Docs
Date Picker is an input field that allows the user to enter a date by typing or by selecting from a calendar overlay....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found