I’m trying to let the user clear a DatePicker value, but I can’t get it to behave the way I expect.
-
If I delete the date from the DatePicker and then click somewhere else or press Escape, the previously selected date comes back instead of staying empty.
The only way I’ve found to actually clear it is to delete the date and press Enter while it’s empty. That does set the value toNone, but it’s not intuitive for users to have to press Enter to clear a date. -
Even after I clear it by pressing Enter, when I click back into the DatePicker, it preselects the old date that was set before it was cleared, and shows it again.
Is there a way to:
- Allow the user to clear the DatePicker simply by deleting the date and unfocusing the field (without needing to press Enter), and
- Ensure that once cleared, the previous date is not automatically reselected the next time the DatePicker is opened?
Thank you in advance.