mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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:
parent
5ba8ea8725
commit
90b5fef9dc
1 changed files with 5 additions and 2 deletions
|
|
@ -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();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue