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
Jonny-Zou opened this issue Aug 13, 2018 · 10 comments

Comments

Projects
None yet
7 participants
@Jonny-Zou
Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

commented Aug 13, 2018

We don't support YearPicker yet, trace #4524

@afc163 afc163 closed this Aug 13, 2018

@afc163 afc163 referenced this issue Nov 23, 2018

Closed

DatePicker with mode="year" doesn't work #13238

1 of 1 task complete
@guxingke201

This comment has been minimized.

Copy link

commented Nov 26, 2018

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

@zombieJ

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

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

@afc163

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

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

@guxingke201

This comment has been minimized.

Copy link

commented Nov 26, 2018

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

@afc163

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

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

@Aladingding

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Apr 4, 2019

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

@afc163

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.