Sitelet https://github.com/angular/components/pull/31643
Skip to content

fix(material/form-field): resolve memory leak - #31643

Merged
crisbeto merged 1 commit into
angular:mainfrom
crisbeto:form-field-render-effect-leak
Aug 4, 2025
Merged

crisbeto merged 1 commit into
angular:mainfrom
crisbeto:form-field-render-effect-leak

Conversation

@crisbeto

@crisbeto crisbeto commented Aug 4, 2025

Copy link
Copy Markdown
Member

Inside the form field we have a afterRenderEffect that updates the label offset when in outlined mode. The logic for calculating the label offset depends on reading Directionality.valueSignal which ends up triggering a memory leak in the framework (angular/angular#62980).

These changes add a temporary workaround that removes the valueSignal from the signal graph in order to avoid the leak until it's fixed on the framework side.

Inside the form field we have a `afterRenderEffect` that updates the label offset when in outlined mode. The logic for calculating the label offset depends on reading `Directionality.valueSignal` which ends up triggering a memory leak in the framework (angular/angular#62980).

These changes add a temporary workaround that removes the `valueSignal` from the signal graph in order to avoid the leak until it's fixed on the framework side.
@crisbeto
crisbeto requested a review from a team as a code owner August 4, 2025 08:53
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Aug 4, 2025
@crisbeto
crisbeto requested review from ok7sai and wagnermaciel and removed request for a team August 4, 2025 08:53
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 4, 2025
@crisbeto
crisbeto merged commit 96117bc into angular:main Aug 4, 2025
@crisbeto

crisbeto commented Aug 4, 2025

Copy link
Copy Markdown
Member Author

The changes were merged into the following branches: main, 20.1.x

crisbeto added a commit that referenced this pull request Aug 4, 2025
Inside the form field we have a `afterRenderEffect` that updates the label offset when in outlined mode. The logic for calculating the label offset depends on reading `Directionality.valueSignal` which ends up triggering a memory leak in the framework (angular/angular#62980).

These changes add a temporary workaround that removes the `valueSignal` from the signal graph in order to avoid the leak until it's fixed on the framework side.

(cherry picked from commit 96117bc)
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Sep 4, 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/form-field target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants