Skip to content

Bug-Angular Material-Nested Tree. #20549

Closed
@aydinmaz

Description

@aydinmaz

In the example of nested Tree ,for the node without children there should't be matTreeNodeToggle tag , it is like this :

<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle>




  • {{node.name}}

  • but it should be like :

    <mat-tree-node *matTreeNodeDef="let node" >




  • {{node.name}}

  • by having this tag, everytime you click on a node without children , state of treeControl.isExpanded(node) changes to false and true ,which is incorrect . in the example it doesn't create problem but in real case if you want to add more logic ,it creates problem.

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/treegood first issueThis issue is a good place to start for first time contributors to the projecthelp wantedThe team would appreciate a PR from the community to address this issue

      Type

      No type

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions