Skip to content

Commit 4d0fc19

Browse files
authored
fix(cdk/tree): set index in context (#31709)
We already had the `index` inside `insertNode`, but we weren't passing it along to the context. Fixes #31578.
1 parent 9d48ab3 commit 4d0fc19

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cdk/tree/tree.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ export class CdkTree<T, K = T>
603603

604604
// Node context that will be provided to created embedded view
605605
const context = new CdkTreeNodeOutletContext<T>(nodeData);
606+
context.index = index;
606607

607608
parentData ??= this._parents.get(key) ?? undefined;
608609
// If the tree is flat tree, then use the `getLevel` function in flat tree control

0 commit comments

Comments
 (0)