dcc.DatepicerSingle resets target element on clear

Hello, I have a map that uses a DatePickerSingle to allow users to change the date to view historical data on the map. The challenge I have now is that I would like to use the clear button on the datepicker, but when the user clicks the clear button, the field is cleared but then the map is also reset to the current date. This is subtle, and so I don’t want it to cause users to think they are still looking at the last selected date. Is there a way to control the clear button so that it just clears the input field, but does not reset the target element until a new date is selected?

HI @Elliott, I would combine the date picker and the clear button into one callback and return the data correspondent to the triggering component using ctx (callback_context).

@AIMPED Hmm, that might work. I’ll take a look. Thanks for the idea!

1 Like