Skip to content

bug(MatTreeModule): Tree with checkboxes example - Reversed checkbox selected values when node has no child #20085

Closed
@NourasHamwi

Description

@NourasHamwi

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/fork/components-issue

Steps to reproduce:

  1. Open Tree with checkboxes on StackBlitz https://stackblitz.com/angular/krgkldbxvgb?file=src%2Fapp%2Ftree-checklist-example.ts
  2. Add example: {} to const TREE_DATA

Expected Behavior

What behavior were you expecting to see?

The added node this.checklistSelection should be selected when the node is selected and should show not selected when the node is not selected.

Actual Behavior

What behavior did you actually see?

For the added node the selection values are reversed.

Environment

  • Angular: 10
  • CDK/Material: 10
  • Browser(s): chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/treedocsThis issue is related to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions