Skip to content

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

Closed

Description

@ghostflow
  • 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

Activity

  1. ant-design-bot commented on Aug 2, 2018

    @ant-design-bot
    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.

  2. ghostflow commented on Aug 2, 2018

    @ghostflow
    Author

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

  3. jrschumacher commented on Aug 31, 2018

    @jrschumacher

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

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

  4. jrschumacher commented on Sep 10, 2018

    @jrschumacher
  5. tcatche commented on Sep 14, 2018

    @tcatche

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

  6. jrschumacher commented on Sep 19, 2018

    @jrschumacher

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

  7. tcatche commented on Oct 12, 2018

    @tcatche

    @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"

  8. afc163 commented on Oct 12, 2018

    @afc163
    Member

    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.

  9. Fujitomy commented on Mar 29, 2019

    @Fujitomy

    <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的解决办法

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

  10. afc163 commented on Jun 5, 2019

    @afc163
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions