Skip to content

Commit

Permalink
Remove sticky-menu class preventing full admin page scroll
Browse files Browse the repository at this point in the history
Gutenberg adds ‘is-fullscreen-mode’ to the page body class, causing WordPress to add ‘sticky-menu’. This prevents the page being vertically scrolled, cutting off long admin menus.

Remove ‘sticky-menu’ as part of the FullscreenMode setup
  • Loading branch information
johngodley committed Oct 31, 2018
1 parent 3503c0d commit 1e4a309
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/edit-post/src/components/fullscreen-mode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { withSelect } from '@wordpress/data';
class FullscreenMode extends Component {
componentDidMount() {
this.sync();

// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as
// a consequence of the FullscreenMode setup
document.body.classList.remove( 'sticky-menu' );
}

componentDidUpdate( prevProps ) {
Expand Down

0 comments on commit 1e4a309

Please sign in to comment.