Skip to content

bug(stepper): access to undefined #30864

Closed
@it11ah1

Description

@it11ah1

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

In steppers _updateSelectedItemIndex() this._keyManager is used without checking for undefined.
A problem occurs when calling reset(); after getting the stepper element from viewChild("stepper");

Reproduction

You can see the problem in the sources. No StackBlitz needed.

Expected Behavior

Calling reset() without TypeError

Actual Behavior

TypeError: Cannot read properties of undefined (reading 'updateActiveItem')

Environment

  • Angular: 19.2.2
  • CDK/Material: 19.2.3

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/stepper

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions