phoenix_live_view 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5631,9 +5631,20 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
5631
5631
  return dom_default.all(this.el, `form[${phxChange}]`).filter((form) => form.id).filter((form) => form.elements.length > 0).filter(
5632
5632
  (form) => form.getAttribute(this.binding(PHX_AUTO_RECOVER)) !== "ignore"
5633
5633
  ).map((form) => {
5634
- const clonedForm = form.cloneNode(false);
5635
- dom_default.copyPrivates(clonedForm, form);
5636
- Array.from(form.elements).forEach((el) => {
5634
+ const clonedForm = form.cloneNode(true);
5635
+ morphdom_esm_default(clonedForm, form, {
5636
+ onBeforeElUpdated: (fromEl, toEl) => {
5637
+ dom_default.copyPrivates(fromEl, toEl);
5638
+ return true;
5639
+ }
5640
+ });
5641
+ const externalElements = document.querySelectorAll(
5642
+ `[form="${form.id}"]`
5643
+ );
5644
+ Array.from(externalElements).forEach((el) => {
5645
+ if (form.contains(el)) {
5646
+ return;
5647
+ }
5637
5648
  const clonedEl = el.cloneNode(true);
5638
5649
  morphdom_esm_default(clonedEl, el);
5639
5650
  dom_default.copyPrivates(clonedEl, el);
@@ -5774,7 +5785,7 @@ removing illegal node: "${(childNode.outerHTML || childNode.nodeValue).trim()}"
5774
5785
  }
5775
5786
  // public
5776
5787
  version() {
5777
- return "1.1.2";
5788
+ return "1.1.3";
5778
5789
  }
5779
5790
  isProfileEnabled() {
5780
5791
  return this.sessionStorage.getItem(PHX_LV_PROFILE) === "true";