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

After set RangePicker's mode to ['month', 'month'], choose the second panel can't close the panel #11586

Closed
1 task done
ghostflow opened this issue Aug 2, 2018 · 10 comments
Closed
1 task done
Assignees

Comments

@ghostflow
Copy link

ghostflow commented Aug 2, 2018

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

Version

3.7.3

Environment

mac os / chrome / react 16.4.1

Reproduction link

http://ant-design.gitee.io/components/date-picker-cn/

Steps to reproduce

  1. set RangePicker's mode to ['month', 'month']
  2. choose startMonth
  3. choose endMonth

What is expected?

the rangepicker should fade out

What is actually happening?

it's still there.
when I click the blank space,it disappeared.


in the situation, only onPanelChange triggered.onChange, onCalendarChange does not triggered

@ant-design-bot
Copy link
Contributor

Hello @ghostflow. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro. Issues labeled by Need Reproduce will be closed if no activities in 7 days.

@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Aug 2, 2018
@ghostflow
Copy link
Author

you can confirm it at the official docs.
the Controlled Panels demo

@afc163 afc163 removed the 🤔 Need Reproduce We cannot reproduce your problem label Aug 2, 2018
@jrschumacher
Copy link

This is also true when doing <DatePicker mode="year" /> while <DatePicker /> works.

Ref: https://repl.it/repls/ScratchyEqualPrintablecharacter

@jrschumacher
Copy link

@afc163

@tcatche
Copy link

tcatche commented Sep 14, 2018

貌似 onChange 事件不能触发,导致在表单中无法正常使用

@jrschumacher
Copy link

@tcatche is this something which I need to fix in my code or is it related to ant/rc-datepicker?

@tcatche
Copy link

tcatche commented Oct 12, 2018

@tcatche is this something which I need to fix in my code or is it related to ant/rc-datepicker?

The problem seems that a bug that onChange event can't triggered when use mode="year" or mode="month"

@afc163
Copy link
Member

afc163 commented Oct 12, 2018

It is not a bug, <DatePicker mode="year" /> don't equal to <YearPicker /> and <DatePicker mode="month" /> don't equal to <MonthPicker />, you guys can trace #4524 for further move.

Also you can control date panel visibility by open and onOpenChange.

@Fujitomy
Copy link

Fujitomy commented Mar 29, 2019

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

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

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

四个方法并用一定能完美实现你的需求,哈哈哈,官方说,你既然都单选了,为什么不用下拉框,说的好有道理,我竟无言以对
阿里产品真的考虑周全呀,>_< 但是我们产品说,我就要这样,我不管

@afc163
Copy link
Member

afc163 commented Jun 5, 2019

@aladingding #16984

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

No branches or pull requests

7 participants