-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An extra container class is getting added to the first element of each Query Loop #41026
Comments
I can confirm the problem on the front, not the editor. I think it might be an issue with this piece of code in the layout support. |
Thanks for reporting this @ndiego! That's an interesting problem indeed. It seems we have layout support in The problem here occurs because I'm not sure yet how it would be best to handle this: specifically for Post Template or if it's a case we should try to find some generic solution. Maybe before adding the extra classes there, make sure the first node contains the --cc @andrewserong @ramonjd |
Oh, interesting problem! Edit: I think the issue was to do with the block adding the wrapper |
I've put together a fix for this in #41802: I believe the issue is that the block was manually creating the wrapper This seems to fix it on the site frontend for me, but could use some more manually testing if folks have time, to make sure I haven't missed anything. 🙂 |
Based on feedback, I've opened an alternative PR to explore a potential fix in #41827 🙂 |
Description
If you create a Query Loop, the first block inside of the Query loop will receive an erroneous
wp-container-#
class. This causes a major issue when that block is a Group block because the block will then receive two container classes. These classes add competing block gap specifications, especially with Rows and Stacks.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Group block with multiple container classes when the first child.
Group block with only one class when placed second, but note that now the Cover block has the
wp-container-8
class, which it shouldn't.Environment info
This issue exists in 6.0 RC2 as well as Gutenberg 13.2
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: