In recent versions ob Bricks Builder the class change of “listening” html elements, for example in case of the accordeon, is very delayed. Previously, when using the accordeon element for example, the class “brx-open” was added right after clicking the accordeon in order for it to open.
Now the class “brx-open” is only added after the accordeon is fully opened. As I use the classes for styling like animations, this makes it look pretty odd.
If anyone is interested, I actually found a solution. Use the following JavaScript to add a new class upon click:
document.querySelectorAll(‘.accordion-title-wrapper’).forEach(header => {
header.addEventListener(‘click’, function() {
var parentElement = this.closest(‘.brxe-block.listening’);
if (parentElement) {
parentElement.classList.toggle(‘insta-open’);
}
});
});
Maybe this new behaviour could be thought about still, as the instant add of the class is way more useful in my opinion, especially for animation purposes.
while this is true, this also means that the animation speed of the accordeon expansion is adjusted accordingly. So setting it to a very low transition also means that the opening or closing animation will be extremely fast or non existant.
Maybe you could also work around that in some way to achieve both goals of (1: opening animation) and (2: text fade-up & indicator icon rotation) but for me, the custom js solutions suits my case the best.