Skip to content

the parameter of onChange is wrong when I click cancel button in RangePicker #757

@tnyo43

Description

@tnyo43

Production like

https://codesandbox.io/p/sandbox/rc-range-picker-onclick-fg9q9p?file=%2Fsrc%2FApp.tsx%3A1%2C1-21%2C1

Steps to reproduce

  1. open the reproduction
  2. open dev tool
  3. fill the dates
  4. click the cancel button (icon with "x")
  5. see the console

What is expected?

The first parameter of onChange and onCalendarChange should be same.
I'm not sure how it is actually, but I think [null, null] makes scence.

In the document, the type of the onChange should be (value: [moment], formatString: [string, string]) => void (in the docs, it is written as Function(value:[moment], formatString: [string, string])). value can't be null.

What is actually happening?

The first parameter of onChange and onCalendarChange are different.
onChange ... null
onCalendarChange ... [null, null]

Environment Info
rc-picker 4.1.1
React 18.2.0
System macOS 14.0
Browser Google Chrome Version 121.0.6167.139

Metadata

Metadata

Assignees

No one assigned

    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