- This topic has 13 replies, 6 voices, and was last updated 2 years, 3 months ago by Alok Sharma.
-
AuthorPosts
-
March 18, 2020 at 2:41 am #1198117Phuc
There’s a horizontal scrollbar, when setting default gutenberg blocks to full width.
You might not see this on the mac, because the scrollbar is only visible, when you scroll.
But on Linux and Windows it’s visible and caused by.no-sidebar .entry-content .alignfull { max-width: 100vw; }
I don’t see a fix for this with this method. I don’t apply the default width to the container but to the items inside the container.
You can test it by yourself by setting the layout without sidebar
March 18, 2020 at 7:59 am #1198571LeoStaffCustomer SupportHi there,
Try this CSS:
body { overflow-x: hidden; }
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know if this helps ๐
March 18, 2020 at 8:01 am #1198576PhucI had the same idea, the problem is, that all the padding calculations are wrong, since the width of the scrollbar messes up the whole calculation. And all the browsers have different scrollbar widths.
March 18, 2020 at 8:05 am #1198583LeoStaffCustomer SupportThat’s the only solution we have currently unfortunately.
I’m not sure about the padding issue though, can you apply it so I can see?
March 18, 2020 at 8:17 am #1198597PhucTrue, I guess that wrong calculation happened, while I was trying to adjust the behaviour of the group blocks.
March 18, 2020 at 9:13 am #1198648LeoStaffCustomer SupportSounds good.
January 19, 2021 at 7:40 pm #1625725GregI have run into this while considering whether or not to use GP on a new site. When the scrollbar is visible, the expectation is that “full width” does not include the scrollbar, because that is what causes horizontal scroll. Regrettably, 100vw includes the scrollbar. To fix the horizontal scroll, the left and right margins for
.no-sidebar .entry-content .alignfull
need to becalc((-100vw + 15px) / 2 + 100% / 2)
, but only when the vertical scrollbar is visible.January 20, 2021 at 1:00 am #1625945PhucThe problem is, that you don’t know, when the Scrollbar is visible unless you use JavaScript.
Another way to solve this problem is to always show the scrollbar, even if it isn’t needed. But I wouldn’t suggest that.May 8, 2021 at 5:57 pm #1770784Greg@Leo When it comes down to it, GP is incompatible with alignfull, at least on systems that have scroll bars. Seems like something should be done about that, as it’s a standard WP feature.
May 9, 2021 at 10:02 am #1771522TomLead DeveloperLead DeveloperHi Greg,
There’s not much we can do about it. If the content area has a defined width, there is no way to break out of that width without using the code above, which isn’t perfect by any stretch.
The only “solution” is to:
1. Remove the defined width from the content so it’s a full width area.
2. Define the content width to everything inside the content except for align full items.This isn’t a solution the theme can offer without major backward compatibility implications – it’s simply not worth it.
If you want to mix contained and full width areas on a page, you should:
1. Remove the defined width from the content: https://docs.generatepress.com/article/content-container/
2. Use a plugin like GenerateBlocks to add containers to your content so you can define the width for each section differently.This is a way better method than using
:not()
selectors in your content to define amax-width
to everything except for align full blocks in my opinion.December 10, 2021 at 9:56 am #2045035Gregdocument.addEventListener("DOMContentLoaded", function() { /* Detect Visible Scrollbars */ if ( window.innerWidth > document.documentElement.clientWidth ) { document.documentElement.classList.add( 'visible-scrollbars' ); } });
.visible-scrollbars .no-sidebar .entry-content .alignfull { margin-left: calc((-100vw + 15px) / 2 + 100% / 2); margin-right: calc((-100vw + 15px) / 2 + 100% / 2); }
January 11, 2022 at 12:28 am #2076231Alok Sharma@Greg, I tried your solution, but it didn’t work.
@Tom, I am using Beaver Builder & Beaver Themer and I use full-width layouts for certain modules, and they work perfectly fine, no overflow at all.I also tried full-width layout for a container block in Astra theme and overflow didn’t happen there as well.
Don’t know why it happens with GeneratePress only.
Apart from the following work-around, is there any other way to fix this issue?
body { overflow-x: hidden; }
January 11, 2022 at 12:57 am #2076245ElvinStaffCustomer SupportHi @Alok,
Can you open a new topic for this? so this topic doesn’t get to convoluted as the solutions proposed isn’t written for your site specifically.
Opening a new topic will atleast make sure the solutions is centered around the site you’re trying to fix. ๐
Apart from the following work-around, is there any other way to fix this issue?
The other way to fix this is to try to find and fix the element that’s causing the overflow issue that creates the horizontal scroll you see. It’s a tricky one to do as this will require close inspection of the page’s content.
January 11, 2022 at 2:51 am #2076314Alok SharmaHi,
Actually, the problem is very much related to this thread. I have anyway created a new topic:
https://generatepress.com/forums/topic/overflow-x-issue-with-full-width-container/
-
AuthorPosts
- You must be logged in to reply to this topic.