OnChange event not getting triggered when entering invalid date in DatePicker.

0 Answers 350 Views
DatePicker
Soumita
Top achievements
Rank 1
Soumita asked on 16 Nov 2022, 08:50 AM
When I enter a date in invalid format (e.g. month/9/year or 11/day/year) manually and then try to clear it, the date doesn't get cleared out and onChange event is not getting called. Is there any way to clear out the invalid date from the date picker?
Wissam
Telerik team
commented on 16 Nov 2022, 02:44 PM

Hi, Soumita,

This is happening because the default Javascript Date object which is used in the DateInput component (rendered inside DatePicker), does not support partial dates. Thus, the `onChange` event is not triggered unless the user enters the full date.

We already have a feature request for clearing partial dates in the DatePicker in our feedback hub. I would recommend voting for it in order to increase the item's priority:

You can find more detailed information about this improvement in the GitHub issue linked inside (and the ones related to it):

I hope this helps, but please let us know if you have any further questions.

Regards,
Wissam
Progress Telerik

No answers yet. Maybe you can help?

Tags
DatePicker
Asked by
Soumita
Top achievements
Rank 1
Share this question
or