DatePicker select month & year will close panel unexpectedly
See original GitHub issueVersion
2.9.1
Environment
win10最新,chrome最新 react react-dom 15.5.4
Reproduction link
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:
- Created 6 years ago
- Comments:16 (10 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
rm -rf node_modules && npm i
重现了:https://ant.design/components/date-picker-cn/
我刚才重新部署了网站。