One of the main obstacles we face is that WordPress destroys and recreates blocks with paintings, so I implemented a 600ms delay for frames to update in order to overcome this issue. While this workaround does function, it may not be the most optimal solution.
radios = document.querySelectorAll('.jet-color-image-list__item');
function getSetColor(index) {
setTimeout(() => {
buttons = document.querySelectorAll('.jet-color-image-list__row.jet-filter-row');
holder = document.querySelectorAll('.elementor-jet-woo-products');
frames = document.getElementsByClassName('jet-woo-product-thumbnail');
for (i = 0; i < radios.length; i++) {
if (radios[i].firstElementChild.checked) {
activeColor = buttons[i].firstElementChild.lastElementChild.firstElementChild.firstElementChild.style.backgroundColor;
}
}
for (i = 0; i < frames.length; i++) {
frames[i].style.borderColor = activeColor
}
}, 600);
};
for (i = 0; i < radios.length; i++) {
radios[i].addEventListener('click', getSetColor);
};