Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try: Improve scrolling of navigation menu on small screens
We scroll the editing canvas, the inspector sidebar, and the block library independently at desktop breakpoints. We do this so that the sidebar inspector can stay in view even if you have scrolled far down the editing canvas, and to avoid scroll bleed. However because the navigation sidebar (on the left) has flyout menus on the desktop breakpoints, we can't yet scroll this one separately. If a user has a bunch of plugins installed that add menu items, or a small screen, these manu items might go beyond the visible height of the viewport. To make these accessible regardless, when this happens the `body` element scrolls to let you reach them. In this situation, there is currently an issue where the editing canvas might scroll out of view when you scroll to the bottom of the sidebar. This PR improves that situation by making the editing canvas `position: fixed;`, same as the sidebar is. This ensures that the entire editor scrolls with you down the page, as you scroll the `body` content. This needs a good testing. `position: fixed;` does not inherit from a relative parent, which means we have to specifiy a matrix of left margins to accommodate for the different configurations of the navigation menu: auto-collapsed, manually collapsed, or the default width. To test, please verify that everything works as intended. Please test: - All breakpoints beyond the 600px small breakpoint. - Fullscreen and not fullscreen modes. - With the navigation menu auto collapsing, and explicitly collapsed. - With the inspector sidebar present or hidden. - With metaboxes present and not present.
- Loading branch information