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

DatePicker 在mode={'year'} 情况下,点击年份,面板不消失 #11735

Closed
1 task
Jonny-Zou opened this issue Aug 13, 2018 · 10 comments
Closed
1 task

DatePicker 在mode={'year'} 情况下,点击年份,面板不消失 #11735

Jonny-Zou opened this issue Aug 13, 2018 · 10 comments

Comments

@Jonny-Zou
Copy link

@Jonny-Zou Jonny-Zou commented Aug 13, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.6.2

Environment

window10, chrome 63

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Edit antd reproduction template

What is expected?

点击年份能选择

What is actually happening?

点击年份面板不消失,也无数据回调

@ant-design-bot
Copy link
Contributor

@ant-design-bot ant-design-bot commented Aug 13, 2018

Translation of this issue:


DatePicker In the case of mode={'year'}, click on the year, the panel does not disappear

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.6.2

Environment

Window10, chrome 63

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Edit antd reproduction template

What is expected?

Click on the year to choose

What is actually happening?

Click the year panel does not disappear, no data callback

@afc163
Copy link
Member

@afc163 afc163 commented Aug 13, 2018

We don't support YearPicker yet, trace #4524

@guxingke201
Copy link

@guxingke201 guxingke201 commented Nov 26, 2018

@afc163 文档改下呗,如果不想支持Year
image

@zombieJ
Copy link
Member

@zombieJ zombieJ commented Nov 26, 2018

@guxingke201
是没有直接的 YearPicker,不是 DatePicker 没有 Year 面板。参考一下受控面板

@afc163
Copy link
Member

@afc163 afc163 commented Nov 26, 2018

<DatePicker mode="month" /> don't equal to <MonthPicker />.

@guxingke201
Copy link

@guxingke201 guxingke201 commented Nov 26, 2018

好的,明白了,感谢回复。
也就是说这个pr是不会合并的?

@afc163
Copy link
Member

@afc163 afc163 commented Nov 26, 2018

应该会的,这两个都不是同一件事。

@Fujitomy
Copy link

@Fujitomy Fujitomy commented Mar 29, 2019

<LocaleProvider locale={zhCN}> { getFieldDecorator(field)( <DatePicker style={ style } placeholder={ placeholder || '请选择年份' } locale={ zhCN } // value={ this.state.time } open={ this.state.yearStartShow } mode='year' format='YYYY' // onChange={ this.handleChange } onOpenChange={ this.handleOpenChange.bind(this,'yearStart') } onPanelChange={ this.handlePanelChange.bind(this,'yearStart') } /> ) } </LocaleProvider>

do like this ,you will fix this bug, use onOpenChange and onPanelChange (maybe you need onFocus)

tks, 一江西流 关于antd 日期组件只选择年份,设置mode=year无法获取value的解决办法

四个方法并用一定能完美实现你的需求

@tyawei
Copy link

@tyawei tyawei commented Apr 4, 2019

这么大的一个bug,antd都不修复一下

@afc163
Copy link
Member

@afc163 afc163 commented Jun 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants