From 6483c19e7c533b1d702d15bef3f6acb28a027e5d Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 30 Nov 2018 00:15:15 -0500 Subject: [PATCH] Adds smooth scrolling to settings jumps --- src/ui/scss/main.scss | 2 +- src/ui/shared/app-base.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui/scss/main.scss b/src/ui/scss/main.scss index b9660de..d119156 100644 --- a/src/ui/scss/main.scss +++ b/src/ui/scss/main.scss @@ -878,7 +878,7 @@ ul { .section-group__content { flex: auto 1 1; - margin-bottom: 50%; + margin-bottom: 100%; min-width: 0; } diff --git a/src/ui/shared/app-base.ts b/src/ui/shared/app-base.ts index 0ad946c..6d0af8e 100644 --- a/src/ui/shared/app-base.ts +++ b/src/ui/shared/app-base.ts @@ -171,11 +171,11 @@ export abstract class App { height = header.clientHeight; } - el.scrollIntoView({ - block: 'start', - behavior: 'auto' + const top = el.getBoundingClientRect().top - document.body.getBoundingClientRect().top - height; + window.scrollTo({ + top: top, + behavior: 'smooth' }); - window.scrollBy(0, -height); e.stopPropagation(); e.preventDefault();