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:

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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