DropDownTree filtering can cause error

1 Answer 552 Views
DropDownTree
Joel
Top achievements
Rank 1
Iron
Joel asked on 08 Apr 2022, 08:56 PM

I have encountered an error while using filtering with DropDownTree.  I am currently using kendo-angular-dropdowns 5.5.1 in my project, but I have reproduced this error with 6.0.2.  Here are the conditions:

  • Use kendoDropDownTreeFlatBinding with kendoDropDownTreeExpandable directive.
  • Setup value binding and initialize the value to a child entry in the list.
  • Run and attempt to filter the dropdown.  Some searches will produce the error:

ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ng-untouched: true'. Current value: 'ng-untouched: false'.

I have reproduced the error at https://angular-e7ahkr.stackblitz.io:

  • Open the console while running the example.
  • Type "nan" in the dropdown search bar.
  • I'm not certain this matters, but notice that both Nancy Davlio and Steven Buchanan are found in the results, and that Steve has child nodes.
  • Now press "c" to make the filter "nanc" and the error will occur in the console.  This will also cause focus to be removed from the search bar.

Is there anything I can do to work around this?  Here is the code for app.component.ts in case the StackBlitz doesn't work:

import { Component } from '@angular/core';
@Component({
  selector: 'my-app',
  styles: ['.furniture { width: 250px; }'],
  template: `
       <kendo-dropdowntree
           kendoDropDownTreeExpandable
           [kendoDropDownTreeFlatBinding]="data"
           parentIdField="reportsTo"
           valueField="id"
           textField="name"
           [(ngModel)]="person"
           class="furniture"
           [filterable]="true"
           [expandOnFilter]="{ expandMatches: true}"
        >
       </kendo-dropdowntree>
   `,
})
export class AppComponent {
  public dataany[] = [
    { id: 2name: 'Andrew Fuller'reportsTo: null },
    { id: 1name: 'Nancy Davolio'reportsTo: 2 },
    { id: 3name: 'Janet Leverling'reportsTo: 2 },
    { id: 4name: 'Margaret Peacock'reportsTo: 2 },
    { id: 5name: 'Steven Buchanan'reportsTo: 2 },
    { id: 8name: 'Laura Callahan'reportsTo: 2 },
    { id: 6name: 'Michael Suyama'reportsTo: 5 },
    { id: 7name: 'Robert King'reportsTo: 5 },
    { id: 9name: 'Anne Dodsworth'reportsTo: 5 },
  ];
  public person = this.data[6];
}

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 13 Apr 2022, 11:35 AM

Hi Joel,

Thank you for the provided feedback.

That is indeed an issue on our side. That is why I logged it as a bug which can be tracked at the following link:

https://github.com/telerik/kendo-angular/issues/3644

Please accept our apologies until the issue is resolved. I have also updated your account Telerik points for pointing our attention to this issue. Thank you.

Regards,
Svet
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
DropDownTree
Asked by
Joel
Top achievements
Rank 1
Iron
Answers by
Svet
Telerik team
Share this question
or