Skip to content

bug(datepicker): Crash in range picker after selecting start date and moving to next month with arrow keys #31959

@daryne77

Description

@daryne77

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

18.2.14

Description

There is an error in the range picker after selecting a start date and then attempting to navigate to the next month using arrow down key.

ASSERTION ERROR: LView must be defined [Expected=> null != undefined <=Actual]

The navigation works visually and the end date can be selected after the crash.

This is reproducible on the official Angular docs, versions 20 and 19, but not 18.

Reproduction

StackBlitz link: https://stackblitz.com/edit/14k4pgtg?file=src%2Findex.html (official example from Angular docs)

Steps to reproduce:

  1. Select a start date
  2. Press "Arrow Down" until the next month is active

Expected Behavior

No error.

Actual Behavior

Crashes with error:

ERROR Error: ASSERTION ERROR: LView must be defined [Expected=> null != undefined <=Actual]
    at throwError2 (chunk-AEB3MSDC.js?v=2ae8b288:3777:9)
    at assertDefined (chunk-AEB3MSDC.js?v=2ae8b288:3773:5)
    at assertLView (chunk-AEB3MSDC.js?v=2ae8b288:5079:3)
    at detachExistingView (chunk-AEB3MSDC.js?v=2ae8b288:20947:16)
    at LiveCollectionLContainerImpl.detach (chunk-AEB3MSDC.js?v=2ae8b288:20865:12)
    at reconcile (chunk-AEB3MSDC.js?v=2ae8b288:20587:43)
    at ɵɵrepeater (chunk-AEB3MSDC.js?v=2ae8b288:20911:5)
    at MatCalendarBody_Template (@angular_material_datepicker.js?v=9365a00e:12711:9)
    at executeTemplate (chunk-AEB3MSDC.js?v=2ae8b288:10618:5)
    at refreshView (chunk-AEB3MSDC.js?v=2ae8b288:11304:7)

Environment

  • Angular: 20.2.0
  • CDK/Material: 20.2.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/datepickerregressionThis issue is related to a regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions