-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Description
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
I am using the first demo from https://material.angular.dev/cdk/scrolling/overview.
When you conditionally show and hide the scroll viewport, it is not correctly removed by the garbage collector.
Seems somehow connected to:
https://github.com/angular/components/blob/main/src/cdk/scrolling/virtual-scroll-viewport.ts#L214
Is this still bound to the application refs effects scheduler?
Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-luexm4f1?file=src%2Fmain.ts
Steps to reproduce:
- Click the toggle button
- open the dev tools and create a snapshot of the heap
- look for "cdk-virtual-scroll-viewport"
- its detached and retained
Expected Behavior
After removal from the dom, the cdk-virtual-scroll-viewport should not be retained in memory.
Actual Behavior
After removal from the dom, the cdk-virtual-scroll-viewport is retained as detached in memory.
Environment
ng version
Angular CLI: 20.3.9
Node: 20.19.1
Package Manager: npm 10.8.2
OS: linux x64
Angular: 20.3.10
... common, compiler, compiler-cli, core, forms
... platform-browser, router
Package Version
@angular-devkit/architect 0.2003.9
@angular-devkit/core 20.3.9
@angular-devkit/schematics 20.3.9
@angular/build 20.3.9
@angular/cdk 20.2.12
@angular/cli 20.3.9
@schematics/angular 20.3.9
rxjs 7.8.2
typescript 5.9.3
zone.js 0.15.1
