Skip to content

Commit

Permalink
Adds smooth scrolling to settings jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Nov 30, 2018
1 parent edb0a17 commit 6483c19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ui/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ ul {

.section-group__content {
flex: auto 1 1;
margin-bottom: 50%;
margin-bottom: 100%;
min-width: 0;
}

Expand Down
8 changes: 4 additions & 4 deletions src/ui/shared/app-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ export abstract class App<TBootstrap extends Bootstrap> {
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();
Expand Down

0 comments on commit 6483c19

Please sign in to comment.