FIX changing the heading wrapper html tag from section to div

This commit is contained in:
Antoine M 2025-12-11 15:27:42 +01:00
parent 44ee6d61c3
commit 03bfa6ba7b
2 changed files with 9 additions and 9 deletions

View File

@ -34,7 +34,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
</ToggleGroupControl>
</PanelBody>
</InspectorControls>
<section
<div
{...useBlockProps({
className: `carhop-heading carhop-heading--hierarchy-${hierarchy}`,
})}
@ -42,17 +42,17 @@ export default function Edit({ attributes, setAttributes, ...props }) {
<div className="carhop-heading__innerblocks">
<InnerBlocks
template={[
[
"core/heading",
{ placeholder: "Saisir le titre", content: "Titre" },
],
[
"core/paragraph",
{
placeholder: "Saisir le sous-titre supérieur",
content: "Sous-titre supérieur",
content: "Sous-titre",
},
],
[
"core/heading",
{ placeholder: "Saisir le titre", content: "Titre" },
],
]}
allowedBlocks={[
"core/heading",
@ -61,7 +61,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
]}
/>
</div>
</section>
</div>
</>
);
}

View File

@ -3,7 +3,7 @@ import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
export default function save({ attributes }) {
const { hierarchy } = attributes;
return (
<section
<div
{...useBlockProps.save({
className: `carhop-heading carhop-heading--hierarchy-${hierarchy}`,
})}
@ -11,6 +11,6 @@ export default function save({ attributes }) {
<div className="carhop-heading__innerblocks">
<InnerBlocks.Content />
</div>
</section>
</div>
);
}