Skip to content

bug(ListKeyManager): active item reference remains although the child component is already deleted #22249

Closed
@justi7n

Description

@justi7n

Reproduction

https://stackblitz.com/edit/active-item-reference?file=src/app/app.component.html

Steps to reproduce:

  1. Click 'Fill List'
  2. Click 'Clear List'

Expected Behavior

It should display the message 'ActiveItem: null', because the activeItem should be null, when there are no items.

Actual Behavior

It displays the message 'ActiveItem: "0"'.
It has no items, but the activeItem still contains a reference of a deleted node.

Environment

  • Angular: 11.0.4
  • CDK/Material: 11.2.4
  • Browser(s): Chrome
  • Operating System: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccessibilityThis issue is related to accessibility (a11y)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions