Browse Source

Adds smooth scrolling to settings jumps

main
Eric Amodio 6 years ago
parent
commit
6483c19e7c
2 changed files with 5 additions and 5 deletions
  1. +1
    -1
      src/ui/scss/main.scss
  2. +4
    -4
      src/ui/shared/app-base.ts

+ 1
- 1
src/ui/scss/main.scss View File

@ -878,7 +878,7 @@ ul {
.section-group__content { .section-group__content {
flex: auto 1 1; flex: auto 1 1;
margin-bottom: 50%;
margin-bottom: 100%;
min-width: 0; min-width: 0;
} }

+ 4
- 4
src/ui/shared/app-base.ts View File

@ -171,11 +171,11 @@ export abstract class App {
height = header.clientHeight; 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.stopPropagation();
e.preventDefault(); e.preventDefault();

Loading…
Cancel
Save