bug(mat-nested-tree-node): Indent increases by level
Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When we use matTreeNodePadding on
Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-starter-jotfnbjm Steps to reproduce:
- click apple
- click pie
Expected Behavior
The indent should keep 40px for all nested tree nodes.
Actual Behavior
The indent is 40px for level 1, 80px for level 2 ...
Environment
- Angular: 19.2.4
- CDK/Material: 19.2.7
- Browser(s): Chrome, Safari
- Operating System (e.g. Windows, macOS, Ubuntu): MacOS
I suppose the matTreeNodePadding/cdkTreeNodePadding was not designed to work with nested nodes, since they are already displayed in a hierarchical way you can simply add padding like this and it should work fine.
mat-nested-tree-node {
padding-left:40px;
}
but i agree it's confusing, and one would expect the directive to just work regardless.
actually i found in the material docs it's explicitly mentioned that the matTreeNodePadding is only for flat trees
Sounds like this is working as expected. Closing.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.