From 30d55e75cae1adec3fc43c84691975bf8b97db34 Mon Sep 17 00:00:00 2001 From: Kim <1877318+kimsible@users.noreply.github.com> Date: Mon, 17 Aug 2020 10:13:31 +0200 Subject: Add restore scroll position on user-dropdown anchors links and scroll to top on active sub-menu links (#3066) * Add restore scroll position on router same url * Remove settings top anchor * Add scrollToTop on active links fixed sub-menu * Add restore scroll position on notification avatar links * Toggle menu and close pophover when click on active dropdown menu-left link * Add onSameUrlRestoreScrollPosition on user dropdown channels link * Same behavior scrollTop and scroll to anchor everywhere Co-authored-by: kimsible --- client/src/app/app.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/src/app/app.component.ts') diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index ef0b1ae56..b8af4e2c7 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -121,7 +121,7 @@ export class AppComponent implements OnInit, AfterViewInit { // scrollToAnchor first to preserve anchor position when using history navigation if (e.anchor) { setTimeout(() => { - this.viewportScroller.scrollToAnchor(e.anchor) + document.getElementById(e.anchor).scrollIntoView({ behavior: 'smooth', inline: 'nearest' }) }) return -- cgit v1.2.3