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.
@@ -5588,9 +5588,20 @@ var View = class _View {
5588
5588
  return dom_default.all(this.el, `form[${phxChange}]`).filter((form) => form.id).filter((form) => form.elements.length > 0).filter(
5589
5589
  (form) => form.getAttribute(this.binding(PHX_AUTO_RECOVER)) !== "ignore"
5590
5590
  ).map((form) => {
5591
- const clonedForm = form.cloneNode(false);
5592
- dom_default.copyPrivates(clonedForm, form);
5593
- Array.from(form.elements).forEach((el) => {
5591
+ const clonedForm = form.cloneNode(true);
5592
+ morphdom_esm_default(clonedForm, form, {
5593
+ onBeforeElUpdated: (fromEl, toEl) => {
5594
+ dom_default.copyPrivates(fromEl, toEl);
5595
+ return true;
5596
+ }
5597
+ });
5598
+ const externalElements = document.querySelectorAll(
5599
+ `[form="${form.id}"]`
5600
+ );
5601
+ Array.from(externalElements).forEach((el) => {
5602
+ if (form.contains(el)) {
5603
+ return;
5604
+ }
5594
5605
  const clonedEl = el.cloneNode(true);
5595
5606
  morphdom_esm_default(clonedEl, el);
5596
5607
  dom_default.copyPrivates(clonedEl, el);
@@ -5731,7 +5742,7 @@ var LiveSocket = class {
5731
5742
  }
5732
5743
  // public
5733
5744
  version() {
5734
- return "1.1.2";
5745
+ return "1.1.3";
5735
5746
  }
5736
5747
  isProfileEnabled() {
5737
5748
  return this.sessionStorage.getItem(PHX_LV_PROFILE) === "true";