Skip to content

Commit f97b0ed

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 32012a6 commit f97b0ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

blocks/columns/columns.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ export default function decorate(block) {
1212
// for UE as value needs to be saved in different element due to having to walk the DOM tree to set the values
1313
const columnsChild = block.querySelector('div');
1414
const ueBkgdColorAttr = columnsChild?.getAttribute('data-background-color');
15-
console.log('bkgdColorAttr in columns row UE', ueBkgdColorAttr);
15+
console.log('1bkgdColorAttr in columns row UE: ', ueBkgdColorAttr);
1616

1717
const ueTextColorAttr = columnsChild?.getAttribute('data-text-color');
18-
console.log('textColorAttr in columns row UE', ueTextColorAttr);
18+
console.log('1textColorAttr in columns row UE: ', ueTextColorAttr);
1919

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

2323
const cols = [...block.firstElementChild.children];

0 commit comments

Comments
 (0)