Skip to content

Commit 38b0e42

Browse files
committed
fixup! refactor(cdk-experimental/ui-patterns): track focus by item not index
1 parent 615539c commit 38b0e42

File tree

1 file changed

+1
-1
lines changed
  • src/cdk-experimental/ui-patterns/tree

1 file changed

+1
-1
lines changed

src/cdk-experimental/ui-patterns/tree/tree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface TreeItemPattern<V> extends TreeItemInputs<V> {}
3333
*/
3434
export class TreeItemPattern<V> implements ExpansionItem {
3535
/** The position of this item among its siblings. */
36-
readonly index = computed(() => this.parent().children().indexOf(this));
36+
readonly index = computed(() => this.tree().visibleItems().indexOf(this));
3737

3838
/** The unique identifier used by the expansion behavior. */
3939
readonly expansionId: SignalLike<string>;

0 commit comments

Comments
 (0)