NO BUG: FacetWP Filters + Accordion Element Conflict

Bricks Version: 1.5.4
Browser: Brave
OS: macOS
URL: https://bgstg2022.wpengine.com/product-category/firearms/

Using FACETWP on a woocommerce site to filter products. The incompatibility seems to be with Brick’s accordion element specifically when combined with a filter.

Outside of the accordion element, you can select your filters just fine. Inside the element it won’t activate when selected. Almost like its being blocked by something, or something is conflicting with the link.

This worked fine before Bricks 1.5.

Doesn’t work with neither of the Accordion elements (original or nestable).

Bumping an old thread.

WP 6.1.2
Bricks 1.8.1
FacetWP 4.2.1
FacetWP - Bricks Builder integration 0.4

I just discovered this issue as well. What appears to be happening is that FacetWP might be stripping the onclick event listeners from the accordion elements. I’m not sure which side of the integration would be correct to address this. I’ve submitted a support ticket to FacetWP.

For future generations, FacetWP support got back to me and pointed me to adding a listener for facetwp-loaded.

https://facetwp.com/help-center/developers/javascript-reference/facetwp-loaded/

sample function:

function facetwp_bricks_accordion_fix() {
  ?>
	  <script>
		document.addEventListener('facetwp-loaded', function() {
			bricksAccordion();
		});
	  </script>
	<?php
}
add_action( 'wp_footer' , 'facetwp_bricks_accordion_fix' , 100 );

I ended up using their built in Listing posts instead of the Bricks query loop in this instance, but giving this a go again with a simple posts list.

They provide an official function on their Bricks documentation page, but it only seems to work with the first facet change. If I execute another search or filter, the accordions revert to being inoperable, almost like the event listener in the script only runs once or something.

Did the snippet work for you, or do you experience the same thing?

The snippet I shared is still working great for me with a Bricks query loop.