Skip to content

Commit

Permalink
fix: prevent UI jumps when scrolling to a month with bigger header
Browse files Browse the repository at this point in the history
previously when body was higher then window and a bigger header scrolled into view
the UI somtimes jumped back to where the scrolling started

solved by adding a "counter-balance" to be buttom of the screen that
will shrink the same value that the header grows so that the vertical
scroll size does not change while scrolling

my brain hurts
  • Loading branch information
Xiphe committed Jan 8, 2021
1 parent aabb7f3 commit 2c1a670
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/views/CategorySidebar/CategorySidebar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
.categorySidebar {
border-right: none;
height: calc(100% - var(--month-header-height));
transition: height 200ms ease-out;
padding-bottom: calc(300px - var(--month-header-height));
transition: height, padding 200ms ease-out;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
Expand Down
2 changes: 2 additions & 0 deletions src/views/Month/Month.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
.monthInner {
min-height: 100%;
border-right: 1px solid var(--element-border-color);
padding-bottom: calc(300px - var(--month-header-height));
transition: padding 200ms ease-out;
}
.title {
text-align: center;
Expand Down

0 comments on commit 2c1a670

Please sign in to comment.