Skip to content

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Oct 2, 2025

The month view had a detectChanges call that was happening inside a blur event which ended up causing re-entrant change detection and hitting an assertion in the framework. These changes remove it since it doesn't appear to be necessary anymore.

Fixes #31959.

I've also converted the internal calendar state to signals to get a feel for how breaking something like this might be.

The month view had a `detectChanges` call that was happening inside a `blur` event which ended up causing re-entrant change detection and hitting an assertion in the framework. These changes remove it since it doesn't appear to be necessary anymore.

Fixes angular#31959.
…nals

Converts some of the internal calendar state to signals to test the waters on how breaking it would be.
@crisbeto crisbeto requested a review from a team as a code owner October 2, 2025 08:04
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Oct 2, 2025
@crisbeto crisbeto requested review from adolgachev and tjshiu and removed request for a team October 2, 2025 08:04
// the way `_focusActiveCell` is set up at the moment makes it fire at the wrong time
// when navigating one month back using the keyboard which will cause this handler
// to throw a "changed after checked" error when updating the preview state.
this._changeDetectorRef.detectChanges();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting this line is the fix for #31959.

@crisbeto crisbeto added the merge: preserve commits When the PR is merged, a rebase and merge should be performed label Oct 2, 2025
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Oct 2, 2025
@crisbeto crisbeto merged commit 542bb6b into angular:main Oct 2, 2025
30 of 32 checks passed
@crisbeto
Copy link
Member Author

crisbeto commented Oct 2, 2025

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: material/datepicker merge: preserve commits When the PR is merged, a rebase and merge should be performed target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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