Skip to content

DatePicker does not allow manual clear #52473

Open
react-component/picker
#947

Description

@mleister97

Reproduction link

https://ant.design/components/date-picker

Steps to reproduce

  • Choose a date
  • Select the input date string and try to remove it with the remove key

What is expected?

  • onChange should be triggered
  • It should work exactly behave like pressing the clear button

What is actually happening?

  • onChange is NOT triggered
  • it is not possible to remove the value manually
  • the date is re-appearing after removing it manually
20250118-2044-57.1286975.mp4
Environment Info
antd 5.23.1
React 18.2.0
System Windows 11
Browser Latest Chrome

Activity

  1. petercat-assistant commented on Jan 18, 2025

    @petercat-assistant

    I searched through the Ant Design repository for any existing issues related to the manual clearing of the DatePicker and the onChange event not being triggered. Here are some related issues that might be of interest:

    1. Issue #11012 - Specify the time zone in DatePicker
    2. Issue #16030 - DatePicker allowClear is not consistent with TimePicker allowClear
    3. Issue #21189 - DateTimePicker and TimePicker should accept the value without pressing the small ok button (or have a prop to switch it off) [v4]
    4. Issue #27880 - DatePicker has inconsistent behaviour when using with and without "showTime"
    5. Issue #29775 - DatePicker onBlur event issue with forms

    While these issues may not directly address the specific problem you are experiencing, they might provide some insights or workarounds. If none of these issues resolve your problem, it might be a new issue that needs further investigation.

    For now, I recommend checking the configuration of your DatePicker component and ensuring that the allowClear property is set correctly. Additionally, you might want to monitor the Ant Design GitHub repository for any updates or fixes related to this issue.

    If you have any more questions or need further assistance, feel free to ask!

    🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.
  2. mleister97 commented on Feb 9, 2025

    @mleister97
    Author

    bump

  3. yellowryan commented on Feb 17, 2025

    @yellowryan
    Contributor

    这个感觉确实需要解决一下,因为在使用留空功能的时候,一旦选择了日期,就没办法通过手动删除的方式让留空位置留空,必须要点击清除按钮才能继续操作
    This feels like something that really needs to be fixed, because when using the allow Empty function, once a date is selected, there is no way to manually delete the value, and you must click the Clear button to continue.

    image

  4. mleister97 commented on Mar 5, 2025

    @mleister97
    Author

    @MadCcc I would not consider this as feature request, but as bug instead

  5. lunaticwithaduck commented on Sep 12, 2025

    @lunaticwithaduck

    bump

  6. alii13 commented on Oct 25, 2025

    @alii13

    Hey folks, I would love to contribute on this issue. If you can assign this issue to me.
    @li-jia-nan / @meet-student

  7. added a commit that references this issue on Oct 27, 2025
    32256d5
  8. mleister97 commented on Jul 29, 2026

    @mleister97
    Author

    IMO, manually removing the date should work as expected. Any updates?

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions