You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WP admin doesn't scroll when on gutenberg screen #4445
Here are some better examples of the issue I'm seeing. (I have a ton of post-types)
These gifs include exactly what I'm seeing on my monitor. Nothing is cut off on the bottom.
Current CSS with overflow: hidden on the body:
I'm unable to scroll the rest of my left sidebar into view. And notice that the editor's scrollbar actually goes out of view, leaving it unknown where you are in the content.
Here is the overflow: hidden removed:
I'm able to scroll all of the sidebar into view, however, the scrollbar still disappears. I also notice the jank that was mentioned in this pr 353ee9c
Here, overflow: hidden is removed and I've added position: relative to .gutenberg since it wraps .gutenberg__editor which is position: absolute:
I'm able to scroll and the editor scrollbar stays in view.
The editor window does get a little out of sync since the document body continues to scroll the height of the sidebar once the editor has scrolled to it's end.
There's got to be a way to stick that editor to the bottom of the viewport. I'll have to play with it some more over the weekend.
I am having the same issue. If my viewport is shorter than my admin content, I can't scroll outside of the Gutenberg edit area and therefore can't access my full admin menu.
Adding the scrollbar to the admin-menu seemed like the cleanest fix and won't even be noticeable to anyone who isn't currently having this problem of not being able to scroll.. It's only applied when the body gets the overflow: hidden (> 600px), so it shouldn't mess with mobile.
I tried to tie the menu in with the body scroll, but just couldn't make it smooth. Also didn't know if we were purposely keeping the scroll off of the body?
I'm just now diving into Gutenberg so I may have missed previous discussions on the layout behavior. @jasmussen looks like you've spent some time with the layout. Is there a reason we wouldn't want the menu to scroll independently? Is there a better way?
Thanks so much for working on this. There are two key issues that we want to make sure doesn't regress:
Scroll-bleed from the inserter. Try opening the inserter on a very long document, then click the "Blocks" tab and mouse-wheel to the end of the blocks tab. Verify that once you've scrolled to the end of that you don't start scrolling the document below.
Mobile breakpoints. Verify that this doesn't regress the mobile scrolling behavior compared to master.
From a quick glance, it looks like #4587 seems to both work well, and not introduce any issues with the above two, as far as I can tell.
I'm going to take a look again next week and see if there is a more elegant way to do it, but my gut tells me there isn't, without dropping the individually scrolling main content area (which would re-introduce the scroll bleed). But I'll get back to you, and thank you again!
Ahh OK, that makes sense.
Yeah, I'm not seeing #4587 have any affect on scroll bleed or mobile or anything else really except for the admin-menu. Which I'm actually kind of liking with a scroll.
One thing I have noticed with #4587 is that the scrollbar cuts into the width that the menu-items have to work with.
So if a menu-item title is maxing out its 160px , it'll get a letter or two cut off. That's with the overflow-x: hidden I put on the menu-wrap. Otherwise a long title will add a horizontal scroll. Both suck as far as backward compatibility.
I haven't tried to fix that part yet. Maybe something can be done with box-sizing or maybe add a couple extra pixels if we have to.
Took another look at the PR, and realized that the reason why there's a horizontal scrollbar, is that the flyout menu has to have space to fit there. Incidentally, our tweaking of overflow breaks that.
Before:
After:
This is a bummer, and means we'll have to take a different approach to addressing this. Thanks again for working on it, though.
haha :)
Your PR removes the overflow: hidden isn't it?
How about this issue you mentioned?
Scroll-bleed from the inserter. Try opening the inserter on a very long document, then click the "Blocks" tab and mouse-wheel to the end of the blocks tab. Verify that once you've scrolled to the end of that you don't start scrolling the document below.
Yep, that's the thing, when the menu needs to scroll, there is a little scroll bleed. When it doesn't, there's no scroll bleed. It's not an ideal fix, and we'll probably want to test thoroughly on metabox heavy configs, but I can't think of another fix that doesn't involve killing the flyout menu.
I fiddled a bit in the inspector and found a way to stop the scrollbleed with css, and looked at a JS solution as well.
The JS idea: https://jsfiddle.net/0o2y3uw9/
With CSS, if you leave the overflow: hidden on the body and add #wpwrap { overflow: auto; height: 100%; }
It sort of moves a few things around which would have to be fixed as well.
One of the cons is that the scrollbar for #wpwrap is hidden (the sidebar sits on top), which can be an accessibility issue (yes, some people actually click and drag the scrollbar).
But each of those come with their own tradeoffs, and none of them fit the wp-admin and its legacy code very well. The same with hiding the scrollbar, it causes that page-jog.
As such, I honestly feel like what we have now, with some scroll bleed in the case of long admin menus, is the most acceptable of the various tradeoffs.
I also don't see any issues with the metabox implementation. This feels issue, to me, appears isolated to the left hand navigation pane. Here's a GIF of the overflow-removing PR:
I acknowledge it's not ideal to see the two scrollbars on the right, on short viewports, but it feels like it is the least disruptive patch, and works reasonably well. Also remember that on mobile we're addressing this in an entirely different way.
For when I need to make long GIFs that aren't insanely huge in filesize (still big, but not crazy), I use Licecap. It uses high compression and low framerates to keep the filesizes down, at the expense of a little choppiness, and light grays disappearing.
When I need to do more high quality GIFs, I used to use Giphy (Mac app store). But now I just screen-record using Quicktime, then open the .mov file in GIF Brewery to convert it to GIF. Finally I run the GIF through ImageOptim to slim down the filesize as much as possible.
It's very practical. It is a little frustrating that GIF is still the best format for this, since it's so old and impractical. But it's just works everywhere, so I find it still the best way to convey little interactions.
Activity
m-e-h commentedon Jan 12, 2018
Here are some better examples of the issue I'm seeing. (I have a ton of post-types)
These gifs include exactly what I'm seeing on my monitor. Nothing is cut off on the bottom.
Current CSS with

overflow: hiddenon thebody:I'm unable to scroll the rest of my left sidebar into view. And notice that the editor's scrollbar actually goes out of view, leaving it unknown where you are in the content.
Here is the

overflow: hiddenremoved:I'm able to scroll all of the sidebar into view, however, the scrollbar still disappears. I also notice the jank that was mentioned in this pr 353ee9c
Here,

overflow: hiddenis removed and I've addedposition: relativeto.gutenbergsince it wraps.gutenberg__editorwhich isposition: absolute:I'm able to scroll and the editor scrollbar stays in view.
The editor window does get a little out of sync since the document body continues to scroll the height of the sidebar once the editor has scrolled to it's end.
There's got to be a way to stick that editor to the bottom of the viewport. I'll have to play with it some more over the weekend.
bamadesigner commentedon Jan 16, 2018
I am having the same issue. If my viewport is shorter than my admin content, I can't scroll outside of the Gutenberg edit area and therefore can't access my full admin menu.
Micemade commentedon Jan 18, 2018
Same / similar issue - referenced above
m-e-h commentedon Jan 19, 2018
I added a fix for this in pr #4587
Adding the scrollbar to the admin-menu seemed like the cleanest fix and won't even be noticeable to anyone who isn't currently having this problem of not being able to scroll.. It's only applied when the body gets the
overflow: hidden(> 600px), so it shouldn't mess with mobile.I tried to tie the menu in with the body scroll, but just couldn't make it smooth. Also didn't know if we were purposely keeping the scroll off of the
body?I'm just now diving into Gutenberg so I may have missed previous discussions on the layout behavior.
@jasmussen looks like you've spent some time with the layout. Is there a reason we wouldn't want the menu to scroll independently? Is there a better way?
jasmussen commentedon Jan 20, 2018
Thanks so much for working on this. There are two key issues that we want to make sure doesn't regress:
From a quick glance, it looks like #4587 seems to both work well, and not introduce any issues with the above two, as far as I can tell.
I'm going to take a look again next week and see if there is a more elegant way to do it, but my gut tells me there isn't, without dropping the individually scrolling main content area (which would re-introduce the scroll bleed). But I'll get back to you, and thank you again!
m-e-h commentedon Jan 20, 2018
Ahh OK, that makes sense.
Yeah, I'm not seeing #4587 have any affect on scroll bleed or mobile or anything else really except for the admin-menu. Which I'm actually kind of liking with a scroll.
One thing I have noticed with #4587 is that the scrollbar cuts into the width that the menu-items have to work with.
So if a menu-item title is maxing out its
160px, it'll get a letter or two cut off. That's with theoverflow-x: hiddenI put on the menu-wrap. Otherwise a long title will add a horizontal scroll. Both suck as far as backward compatibility.I haven't tried to fix that part yet. Maybe something can be done with
box-sizingor maybe add a couple extra pixels if we have to.jasmussen commentedon Jan 22, 2018
Took another look at the PR, and realized that the reason why there's a horizontal scrollbar, is that the flyout menu has to have space to fit there. Incidentally, our tweaking of overflow breaks that.
Before:
After:
This is a bummer, and means we'll have to take a different approach to addressing this. Thanks again for working on it, though.
Try fixing nav menu scroll
marcusig commentedon Jan 22, 2018
@jasmussen
I'm not sure it's an edge case. On my laptop with a few plugins installed which add:
Both the menu bar, the editor's content and the metaboxes get cropped if
body { overflow : hidden; }.I've experimented a bit and found a couple of ways to stop the scrollbleedin' thing, but not sure what's best...
jasmussen commentedon Jan 22, 2018
Note to self: never use the term edge case 😉 it clearly is an issue that needs fixing, whether edge or not.
Incidentally I submitted a PR earlier today that seems to address it: #4629
marcusig commentedon Jan 22, 2018
haha :)
Your PR removes the overflow: hidden isn't it?
How about this issue you mentioned?
jasmussen commentedon Jan 22, 2018
Yep, that's the thing, when the menu needs to scroll, there is a little scroll bleed. When it doesn't, there's no scroll bleed. It's not an ideal fix, and we'll probably want to test thoroughly on metabox heavy configs, but I can't think of another fix that doesn't involve killing the flyout menu.
marcusig commentedon Jan 22, 2018
I fiddled a bit in the inspector and found a way to stop the scrollbleed with css, and looked at a JS solution as well.
The JS idea: https://jsfiddle.net/0o2y3uw9/
With CSS, if you leave the
overflow: hiddenon the body and add#wpwrap { overflow: auto; height: 100%; }It sort of moves a few things around which would have to be fixed as well.
One of the cons is that the scrollbar for #wpwrap is hidden (the sidebar sits on top), which can be an accessibility issue (yes, some people actually click and drag the scrollbar).
m-e-h commentedon Jan 22, 2018
Another JS approach would be to toggle a body class when the inserter is open and hide the overflow only while open.
marcusig commentedon Jan 23, 2018
Could work, but there might be some movement when changing the overflow (showing and hiding the body scrollbar)
jasmussen commentedon Jan 23, 2018
Appreciate your help. I've fiddled myself many times:
But each of those come with their own tradeoffs, and none of them fit the wp-admin and its legacy code very well. The same with hiding the scrollbar, it causes that page-jog.
As such, I honestly feel like what we have now, with some scroll bleed in the case of long admin menus, is the most acceptable of the various tradeoffs.
I also don't see any issues with the metabox implementation. This feels issue, to me, appears isolated to the left hand navigation pane. Here's a GIF of the overflow-removing PR:
I acknowledge it's not ideal to see the two scrollbars on the right, on short viewports, but it feels like it is the least disruptive patch, and works reasonably well. Also remember that on mobile we're addressing this in an entirely different way.
marcusig commentedon Jan 23, 2018
Fair enough. It's also probably the most reasonable and clean code.
Off topic, how do you make those GIF screenshots?
jasmussen commentedon Jan 23, 2018
For when I need to make long GIFs that aren't insanely huge in filesize (still big, but not crazy), I use Licecap. It uses high compression and low framerates to keep the filesizes down, at the expense of a little choppiness, and light grays disappearing.
When I need to do more high quality GIFs, I used to use Giphy (Mac app store). But now I just screen-record using Quicktime, then open the .mov file in GIF Brewery to convert it to GIF. Finally I run the GIF through ImageOptim to slim down the filesize as much as possible.
marcusig commentedon Jan 23, 2018
Thanks. It's quite practical to illustrate all this trials and tests.
jasmussen commentedon Jan 23, 2018
It's very practical. It is a little frustrating that GIF is still the best format for this, since it's so old and impractical. But it's just works everywhere, so I find it still the best way to convey little interactions.
mikestopcontinues commentedon Feb 12, 2019
What about padding the bottom of the gutenberg editor equal to the admin-menu overflow? Then we'd at least see the bottom of the doc.
mikestopcontinues commentedon Feb 12, 2019
Actually, is there anything wrong with using fixed positioning for
.edit-post-layout__content? Basically, treating it the same as.edit-post-sidebar.