generateblocks icon indicating copy to clipboard operation
generateblocks copied to clipboard

Accordion.js - refire on ajax loading

Open diggeddy opened this issue 1 year ago • 1 comments

More and more users are using accordions within loops and those loops are being ajax loaded. The issue we have our accordion.js ( and probably tabs ) is that the script fires on Load.

This requries hack workaorunds to reload the script after ajax loading. See here for a topic where the user is working with FacetWP:

https://generate.support/topic/filters-breaking-accordion-block/#post-69623

Can we review the script so it can be refired on other events

diggeddy avatar Dec 11 '23 12:12 diggeddy

I imagine a simple solve here would be setting up the events using delegation instead of on the actual block elements.

iansvo avatar Dec 11 '23 12:12 iansvo