We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3d4cd4 commit 720d6fcCopy full SHA for 720d6fc
.changeset/fix-angular-virtual-cleanup.md
@@ -0,0 +1,5 @@
1
+---
2
+'@tanstack/angular-virtual': patch
3
4
+
5
+fix: capture \_didMount cleanup to remove scroll/resize listeners on destroy
packages/angular-virtual/src/index.ts
@@ -70,8 +70,12 @@ function createVirtualizerBase<
70
{ allowSignalWrites: true },
71
)
72
73
- let cleanup: () => void | undefined
74
- afterNextRender({ read: () => (virtualizer ?? lazyInit())._didMount() })
+ let cleanup: (() => void) | undefined
+ afterNextRender({
75
+ read: () => {
76
+ cleanup = (virtualizer ?? lazyInit())._didMount()
77
+ },
78
+ })
79
80
inject(DestroyRef).onDestroy(() => cleanup?.())
81
0 commit comments