Skip to content
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

Group block: child group block has multiple inner container div #34404

Closed
2 tasks done
t-hamano opened this issue Aug 31, 2021 · 6 comments · Fixed by #36256
Closed
2 tasks done

Group block: child group block has multiple inner container div #34404

t-hamano opened this issue Aug 31, 2021 · 6 comments · Fixed by #36256
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

Description

The front-end side will output a container ( .wp-block-group__inner-container ) if the HTML element of the group block is the default div .
When group blocks are nested and the HTML element of the parent block is set to something other than div, the descendant group blocks will output multiple containers.

Step-by-step reproduction instructions

  1. Inserts a nested group block.
  2. Select something other than a <div> from "HTML Element" in Advanced panel for the parent group block.

Screenshots, screen recording, code snippet

Block List View Example

- Group Block ( main tag)
	- Group Block ( main tag)
		- Group Block ( div tag)

HTML Outpul Result

<main class="wp-block-group">
	<main class="wp-block-group">
		<div class="wp-block-group">
			<div class="wp-block-group__inner-container">
				<div class="wp-block-group__inner-container">
					<div class="wp-block-group__inner-container"></div>
				</div>
			</div>
		</div>
	</main>
</main>

Environment info

No response

Pre-checks

  • I have searched the existing issues.
  • I have tested with all plugins deactivated except Gutenberg.
@Mamaduka Mamaduka added [Block] Group Affects the Group Block (and row, stack and grid variants) Needs Testing Needs further testing to be confirmed. labels Aug 31, 2021
@t-hamano
Copy link
Contributor Author

I suspect that the cause is that the closing tag in the div.wp-block-group__inner-container box of the Group block is being output in the wrong position.

Here's another example.

Step-by-step reproduction instructions

  • Inserts a group block.
  • Inserts two group blocks in parallel into the parent group block.
  • Sets the HTML element of the parent group block to something other than a div tag.

Editor View

capture_1

Frontend View

capture_2

@talldan
Copy link
Contributor

talldan commented Oct 26, 2021

This sounds like a similar issue to the one reported here - #34199

@talldan
Copy link
Contributor

talldan commented Oct 26, 2021

I could reproduce the second set of steps. An important caveat is that I think reproducing requires a classic theme. I used Twenty Twenty One. In block based themes the group block omits the inner container.

Editor:
Screenshot 2021-10-26 at 1 58 00 pm

Post:
Screenshot 2021-10-26 at 1 58 05 pm

@talldan talldan added [Type] Bug An existing feature does not function as intended and removed Needs Testing Needs further testing to be confirmed. labels Oct 26, 2021
davecpage added a commit to davecpage/gutenberg that referenced this issue Nov 5, 2021
@davecpage
Copy link
Contributor

@talldan you were correct, the issue was similar to the one on #34199 in that the regexes needed to be adjusted.

@davecpage
Copy link
Contributor

@noisysocks Similar to #34199 would this also need to be ported over to the WordPress core for inclusion in 5.9?

@noisysocks
Copy link
Member

The fix #36256 landed in Gutenberg 11.9 which means it's included in WP 5.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants