Kendo-datepicker reactive forms

1 Answer 106 Views
DateTimePicker
Ramakrishna Reddy
Top achievements
Rank 1
Ramakrishna Reddy asked on 14 Jun 2022, 12:29 PM

I am using Kendo-datetimepicker in my Angular app. In my Reactive form i set the intial value as null for FormControlName. When i close the component without updating any value. It shows the following error. Please someone guide me through this. Thanks in Advance.

 

ERROR TypeError: Cannot read properties of null (reading 'isEmpty')
    at DateTimePickerComponent.isEmpty (index.js:8605:53)
    at FloatingLabelComponent.updateState (index.js:463:44)
    at Object.updateState [as next] (index.js:535:40)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:183:1)
    at SafeSubscriber.next (Subscriber.js:122:1)
    at Subscriber._next (Subscriber.js:72:1)
    at Subscriber.next (Subscriber.js:49:1)
    at EventEmitter_.next (Subject.js:39:1)
    at EventEmitter_.emit (core.mjs:22416:15)
    at FormControl.updateValueAndValidity (forms.mjs:2514:31)

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 17 Jun 2022, 06:22 AM

Hi Ramakrishna,

Could I ask you for some more details about how the DateTimePicker is configured.

I tried to reproduce the reported behavior with the following example, but such error was not thrown:

<form [formGroup]="form">
            <kendo-datetimepicker formControlName="checkIn"> </kendo-datetimepicker>
        </form>
  public form: FormGroup = new FormGroup({
    checkIn: new FormControl(null),
  });

https://stackblitz.com/edit/angular-gbxrme

Please do let me know am I missing something.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DateTimePicker
Asked by
Ramakrishna Reddy
Top achievements
Rank 1
Answers by
Martin Bechev
Telerik team
Share this question
or