Skip to content

Commit

Permalink
Padding comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 2, 2018
1 parent 666af65 commit d1966db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions edit-post/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

.edit-post-layout__content {
position: relative;
// Pad the scroll box so content on the bottom can be scrolled up.
padding-bottom: 100vh;

// on mobile the main content area has to scroll
Expand Down
6 changes: 3 additions & 3 deletions utils/get-scroll-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
* @returns {?Element} Scrollable container node, if found.
*/
export function getScrollContainer( node ) {
if ( ! node ) {
return;
if ( ! node || node === document.body ) {
return window;
}

// Scrollable if scrollable height exceeds displayed...
if ( node.scrollHeight > node.clientHeight ) {
// ...except when overflow is defined to be hidden or visible
const { overflowY } = window.getComputedStyle( node );
if ( /(auto|scroll)/.test( overflowY ) ) {
return node === document.body ? window : node;
return node;
}
}

Expand Down

0 comments on commit d1966db

Please sign in to comment.