This is a migrated thread and some comments may be shown as answers.

Clear DatePicker value in Controlled Mode

1 Answer 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
Iron
Iron
Veteran
David asked on 08 Dec 2020, 04:38 AM

Hi,

I am using a datepicker in a form. The form is used for filtering and has a reset button. If I programatically set the value of the datepicker to another value, the value displayed by the datepicker is updated. If I set the datepicker value to undefined (on reset), the underlying value is updated but the value displayed by the datepicker doesn't change. Is this a bug or is there a better way to clear the selected datepicker value?

Kind regards,

David

1 Answer, 1 is accepted

Sort by
0
Accepted
Kiril
Telerik team
answered on 08 Dec 2020, 07:01 AM

Hello David,

In order to reset the value of the DatePicker, please use `null` instead of `undefined`. Across all KendoReact components, we use the `undefined` value as an indication that the component is in uncontrolled mode, and `null` as an indication for an empty value.

Could you please try this and let me know if it solves the problem?

Regards,
Kiril
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Kiril
Telerik team
Share this question
or