From 90b5fef9dc8a3ca69882bf3e5d57ef96cf9fa427 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Tue, 27 Aug 2024 12:09:40 -0700 Subject: [PATCH] fix(docs-infra): Fix scrolling in application (#57554) Since the change to the after render hooks, the "this" context must be correct for the destroy to work. fixes #57552 PR Close #57554 --- adev/src/app/app-scroller.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/adev/src/app/app-scroller.ts b/adev/src/app/app-scroller.ts index 2655994e9a8..aabb2c52d1f 100644 --- a/adev/src/app/app-scroller.ts +++ b/adev/src/app/app-scroller.ts @@ -71,7 +71,7 @@ export class AppScroller { const {anchor, position} = this._lastScrollEvent; // Don't scroll during rendering - this.cancelScroll = afterNextRender( + const ref = afterNextRender( { write: () => { if (position) { @@ -84,6 +84,9 @@ export class AppScroller { }, }, {injector: this.injector}, - ).destroy; + ); + this.cancelScroll = () => { + ref.destroy(); + }; } }