Skip to content

bug(TreeControl): TreeControl's trackBy is unusable #21423

Closed
@alvipeo

Description

@alvipeo

Here's the code to create FlatTreeControl:

    this.treeControl = new FlatTreeControl<GeoEntityFlatNode>(
      (node) => node.nodeLevel,
      (node) => node.expandable,
      { trackBy: this.trackByGroupPath } // ========> DOES NOT COMPILE
    );

and the trackByGroupPath:

  trackByGroupPath(index: number, node: GeoEntityFlatNode): string {
    return node.groupPath;
  }

And this whole thing does not compile as

Type '(node: GeoEntityFlatNode) => string' is not assignable to type '(dataNode: GeoEntityFlatNode) => GeoEntityFlatNode'.

Am I missing something or this makes trackBy completely useless?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions