Skip to content

Commit

Permalink
fix: adjust child element handling in text-image block for 'image-rig…
Browse files Browse the repository at this point in the history
…ht' variant
  • Loading branch information
Bjoern Weide committed Jan 31, 2025
1 parent 8ea8914 commit dbd1776
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blocks/text-image/text-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export default function decorate(block) {
const firstChild = block.firstElementChild;
const secondChild = firstChild.nextElementSibling;
if (secondChild) {
firstChild.appendChild(secondChild);
if (block.classList.contains('image-right')) {
firstChild.parentElement.appendChild(secondChild);
} else {
firstChild.appendChild(secondChild);
}
}
// add variant classnames
variantsClassesToBEM(block.classList, variantClasses, blockName);
Expand Down

0 comments on commit dbd1776

Please sign in to comment.