Different behaviour on invalid values for DatePickerRange and DatePickerSingle


I have a Dash app running these versions:


I noticed a difference between the behaviour of DatePickerRange and DatePickerSingle when invalid values are entered by the user.

DatePickerRange : When the value can’t be parsed (ex.: “2021-03-0” (which happens whenever we change the value by deleting a character to change it)) or the value is outside of the allowed range (defined by min_date_allowed and max_date_allowed), no callback is fired and, if the user focuses out of the element, the last valid date comes back.

DatePickerSingle : If the value can’t be parsed (that is as soon as the user deleted a character to replace it) or is outside of the allowed range, a callback is fired with None as the value for the date property.

The behaviour of DatePickerRange is preferable as we don’t have to deal with the null value downstream.

Is there a reason why the behavior of DatePickerSingle is different?

Thanks for you help and for the great product!