Skip to content

Commit

Permalink
Release 2.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismccord committed Jul 19, 2024
1 parent b1b0797 commit c710ec7
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Changelog

# 2.x

## 2.7.4
- Fix incorrect index references when returning a cloned tree from onBeforeElUpdated

## 2.7.3
- Allow returning a new fromEl tree from onBeforeElUpdated to be used morph for that branch

Expand Down
5 changes: 5 additions & 0 deletions dist/morphdom-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,11 @@ function morphdomFactory(morphAttrs) {
return;
} else if (beforeUpdateResult instanceof HTMLElement) {
fromEl = beforeUpdateResult;
// reindex the new fromEl in case it's not in the same
// tree as the original fromEl
// (Phoenix LiveView sometimes returns a cloned tree,
// but keyed lookups would still point to the original tree)
indexTree(fromEl);
}

// update attributes on original DOM element first
Expand Down
5 changes: 5 additions & 0 deletions dist/morphdom-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ function morphdomFactory(morphAttrs) {
return;
} else if (beforeUpdateResult instanceof HTMLElement) {
fromEl = beforeUpdateResult;
// reindex the new fromEl in case it's not in the same
// tree as the original fromEl
// (Phoenix LiveView sometimes returns a cloned tree,
// but keyed lookups would still point to the original tree)
indexTree(fromEl);
}

// update attributes on original DOM element first
Expand Down
5 changes: 5 additions & 0 deletions dist/morphdom-umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@
return;
} else if (beforeUpdateResult instanceof HTMLElement) {
fromEl = beforeUpdateResult;
// reindex the new fromEl in case it's not in the same
// tree as the original fromEl
// (Phoenix LiveView sometimes returns a cloned tree,
// but keyed lookups would still point to the original tree)
indexTree(fromEl);
}

// update attributes on original DOM element first
Expand Down
2 changes: 1 addition & 1 deletion dist/morphdom-umd.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dist/morphdom.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,11 @@ function morphdomFactory(morphAttrs) {
return;
} else if (beforeUpdateResult instanceof HTMLElement) {
fromEl = beforeUpdateResult;
// reindex the new fromEl in case it's not in the same
// tree as the original fromEl
// (Phoenix LiveView sometimes returns a cloned tree,
// but keyed lookups would still point to the original tree)
indexTree(fromEl);
}

// update attributes on original DOM element first
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"virtual-dom": "^2.1.1"
},
"dependencies": {},
"version": "2.7.3",
"version": "2.7.4",
"keywords": [
"dom",
"diff",
Expand Down

0 comments on commit c710ec7

Please sign in to comment.