react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

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

Open widavies opened this issue 4 days ago โ€ข 0 comments

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

https://github.com/user-attachments/assets/ade76e28-a812-4ced-9a0b-ee493f72d703

(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

widavies avatar Dec 08 '25 06:12 widavies