Navigation Block: block wrapper class name applied to both outer element and its child element #62690
Labels
[Block] Navigation
Affects the Navigation Block
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
If you inspect the markup of a navigation block with the overlay turned off (makes it easier to reproduce), the
wp-block-navigation
class name is applied twice, once to the outer<nav>
and once to its child<ul>
:Blocks should only have the wrapper classname on the outermost element.
The bug seems to be caused by
get_block_wrapper_attributes
being used to compute the attributes of the<ul>
element:gutenberg/packages/block-library/src/navigation/index.php
Lines 177 to 182 in 4907090
A concern is that changing this might cause some issues, it'd require a dev note as it may break some styles, but I think it needs to be fixed to ensure themes don't end up with unsual style rules like
ul.wp-block-navigation
.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
Reproduced on latest trunk core/gutenberg
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: