Skip to content

Commit

Permalink
Fixes the modal animating off screen
Browse files Browse the repository at this point in the history
While using `position: absolute` the modal window will animate relative
to the top of the viewport, i.e., it will always appear where the bottom
of the viewport is when `document.body.scrollTop === 0`. By setting
`position: fixed`, the modal positions itself to the viewport and
therefore will always be visible
  • Loading branch information
Richard Palmer committed Mar 15, 2017
1 parent c8dbd6a commit 89dd341
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/Modal/ModalAnimator.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}

.root {
position: absolute;
position: fixed;
height: 100%;
width: 100%;
top: 0;
Expand All @@ -17,7 +17,7 @@
}

.overlay {
position: absolute;
position: fixed;
width: 100%;
height: 100%;
background-color: var(--overlay-default);
Expand All @@ -31,15 +31,15 @@
}

.wrapper {
position: absolute;
position: fixed;
height: 100%;
width: 100%;
will-change: transform;
backface-visibility: hidden;
}

.window {
position: absolute;
position: fixed;
left: 50%;
bottom: 0;
width: 100%;
Expand Down

0 comments on commit 89dd341

Please sign in to comment.