wp_render_layout_support_flag
renders classes on wrong element
#57242
Labels
[Feature] Layout
Layout block support, its UI controls, and style output.
[Type] Bug
An existing feature does not function as intended
Description
Like the comment here says (in @TODO as well), the wrong element is used when there is no inner block wrapper. This happens for example with a block that uses a
<details>
element and a<summary class="anything">
inside, and then renders the inner blocks directly after the</summary>
like the HTML spec allows/recommends:The
core/details
block is not affected because it just happens to not apply any classes to thesummary
element. But for custom blocks that do (ie:supports.color.__experimentalSkipSerialization
that apply tosummary
instead of the rootdetails
element), this becomes a problem.A workaround is to obviously wrap the inner blocks in a
div
or similar, but this may cause other style issues and is not in line with HTML spec again. And a Make WordPress Core article about inner blocks recommends this approach of adding HTML inline with inner blocks.Step-by-step reproduction instructions
<details { ...innerBlocksProps }><summary className="anything">Summary</summary>{ innerBlocksProps.children }</details>
is-layout-flow
(orflex
, etc) class is applied to thesummary
element instead of thedetails
element.Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.4.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: