Skip to content

Commit 32012a6

Browse files
refactor logic because UE saves after each field, and for some reason background-color gets called twice and returns null on second pass
1 parent 50c4731 commit 32012a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

blocks/columns/columns.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default function decorate(block) {
1717
const ueTextColorAttr = columnsChild?.getAttribute('data-text-color');
1818
console.log('textColorAttr in columns row UE', ueTextColorAttr);
1919

20-
if (ueBkgdColorAttr && ueBkgdColorAttr != null && block.style.backgroundColor && block.style.backgroundColor !== '') block.style.backgroundColor = ueBkgdColorAttr;
21-
if (ueTextColorAttr && ueTextColorAttr != null && block.style.color && block.style.color !== '') block.style.color = ueTextColorAttr;
20+
if (ueBkgdColorAttr && ueBkgdColorAttr != null && block.style.backgroundColor && block.style.backgroundColor == null) block.style.backgroundColor = ueBkgdColorAttr;
21+
if (ueTextColorAttr && ueTextColorAttr != null && block.style.color && block.style.color == null) block.style.color = ueTextColorAttr;
2222

2323
const cols = [...block.firstElementChild.children];
2424
block.classList.add(`columns-${cols.length}-cols`);

0 commit comments

Comments
 (0)