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
This commit is contained in:
Andrew Scott 2024-08-27 12:09:40 -07:00 committed by Alex Rickabaugh
parent 5ba8ea8725
commit 90b5fef9dc

View file

@ -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();
};
}
}