Skip to content

Commit

Permalink
fix: scrolling position
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnygerard committed Feb 5, 2024
1 parent 4d984b8 commit 2e711d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div [@routeAnimations]="routeAnimationState" [@slideshow]="(data$ | async)?.['paintingIndex']">
<div [@routeAnimations]="routeAnimationState" [@slideshow]="(data$ | async)?.['paintingIndex']"
(@routeAnimations.done)="scrollToTop()">
<router-outlet />
</div>
4 changes: 4 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ const slideshowAnimation = animation([
export class AppComponent {
constructor(private _nestedOutlets: ChildrenOutletContexts) { }

scrollToTop(): void {
scrollTo(0, 0);
}

get activatedRoute(): ActivatedRoute | null | undefined {
return (this._nestedOutlets.getContext('primary'))?.route;
}
Expand Down

0 comments on commit 2e711d2

Please sign in to comment.