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.
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.