Skip to content

DatePicker: Clear button should still clear the input when a date is partially filled out #9296

@widavies

Description

@widavies

Provide a general summary of the issue here

When clicking the clear button on a partially filled-out DatePicker, the date text box does not clear.

🤔 Expected Behavior?

I would expect the date to still clear

😯 Current Behavior

The date does not clear

💁 Possible Solution

The clear button sets the date to null, but if there is no date yet (a partially filled out date is invalid, so no date has been set) then this method won't work. Instead, the DatePickerStateContext could be modified to clear the underlying text.

🔦 Context

No response

🖥️ Steps to Reproduce

20251208-0618-58.3289025.mp4

(example used: https://react-spectrum.adobe.com/react-aria/DatePicker.html#state, the date does not clear)

Version

1.13.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Windows 11

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

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