react-spectrum
react-spectrum copied to clipboard
DatePicker: Clear button should still clear the input when a date is partially filled out
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