Headline Block's auto anchor code is causing duplicate identical element ids #315
Labels
💡 Bug
Fixed in WP 5.7 Branch
🔥 Product bug
A bug which is not directly related to a custom child theme.
This code:
bu-blocks/src/blocks/headline/headline.js
Lines 88 to 94 in be9ee86
should be removed as it causes duplicate element id's in a couple scenarios:
The code is only looking at headline blocks that are top level in the tree, it's not seeing headline blocks that are children of other blocks. When they are child blocks the id attribute is incorrect and leads to duplicates which SiteImprove then flags as an level A issue.
When duplicating an existing headline the anchor doesn't change so
headline-1
becomesheadline-1
on the duplicate block too. Admittedly this is how gutenberg works I think but is still not a great idea.I'd suggest removing this feature as it isn't used anywhere and let the editor manually set the anchor in the anchor field.
The text was updated successfully, but these errors were encountered: