From aa22568c64d65824307d6d5ab0cbfe71df3af38a Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 20 Dec 2017 15:37:34 +0000 Subject: [PATCH] Fix bug horizontal scrollbar being pushed off page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We weren’t calculating the height quite right; we were trying to compensate for something that should have been compensated for in the `stick-at-top-when-scrolling` code. Add the 5px to the shim there is required because we’re adding it to the element that the shim in replacing. --- app/assets/javascripts/fullscreenTable.js | 2 +- .../stylesheets/components/stick-at-top-when-scrolling.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/fullscreenTable.js b/app/assets/javascripts/fullscreenTable.js index 5d4080b2f..27ff52636 100644 --- a/app/assets/javascripts/fullscreenTable.js +++ b/app/assets/javascripts/fullscreenTable.js @@ -62,7 +62,7 @@ this.maintainHeight = () => { let height = Math.min( - $(window).height() - this.topOffset + $('html, body').scrollTop() + 5, + $(window).height() - this.topOffset + $('html, body').scrollTop(), this.nativeHeight ); diff --git a/app/assets/stylesheets/components/stick-at-top-when-scrolling.scss b/app/assets/stylesheets/components/stick-at-top-when-scrolling.scss index cee9ffd16..77d076ff1 100644 --- a/app/assets/stylesheets/components/stick-at-top-when-scrolling.scss +++ b/app/assets/stylesheets/components/stick-at-top-when-scrolling.scss @@ -53,4 +53,5 @@ .shim { display: block; + margin-bottom: 5px; }