EmicoEcommerce / Magento2Tweakwise-archived

Magento 2 module for Tweakwise integration
Other
9 stars 25 forks source link

Use replaceWith when updating elements from Ajax call so data-mage-in… #152

Closed jasperzeinstra closed 3 years ago

jasperzeinstra commented 3 years ago

Use replaceWith when updating elements from Ajax call so data-mage-init is re-initiated.

We ran in to an issue that new filters were applied but only the inner content of #layered-filter-block was updated. But for certain JS to still work and have good references with elements that are replaced by the new content it's better to replace the element instead of updating the innerHtml.

bramstroker commented 3 years ago

@jasperzeinstra thanks for the pr. Looks good to me. @stijnbernards can you also have a look?