Skip to content

Commit 458686c

Browse files
imankulovadamghill
authored andcommitted
Fix alpine morpher
Skip morphing if htmlElement is an empty string.
1 parent e1bf7bc commit 458686c

File tree

1 file changed

+3
-1
lines changed
  • django_unicorn/static/unicorn/js/morphers

1 file changed

+3
-1
lines changed

django_unicorn/static/unicorn/js/morphers/alpine.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ See https://www.django-unicorn.com/docs/custom-morphers/#alpine for more informa
1111
}
1212

1313
morph(dom, htmlElement) {
14-
return window.Alpine.morph(dom, htmlElement, this.getOptions());
14+
if (htmlElement) {
15+
return window.Alpine.morph(dom, htmlElement, this.getOptions());
16+
}
1517
}
1618

1719
getOptions() {

0 commit comments

Comments
 (0)