Skip to content

Commit 91c6146

Browse files
committed
Workaround for when HTML elements change tagName via AJAX
1 parent 0e9b367 commit 91c6146

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

view/base/templates/script/html-updater.phtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<script>
22
const LokiHtmlReplacer = {
33
replace(root, newRoot) {
4+
if (root.tagName !== newRoot.tagName) {
5+
root.replaceWith(newRoot);
6+
if (window.Alpine) {
7+
Alpine.initTree(newRoot);
8+
}
9+
10+
return;
11+
}
12+
413
if (root.hasAttribute('x-ignore')) {
514
return;
615
}

0 commit comments

Comments
 (0)