Skip to content

Commit

Permalink
Only build maps if matching element pair
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Apr 1, 2024
1 parent b0762b3 commit 4f0ed50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/morphlex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/morphlex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ class Morph {
}

morphInner(pair: NodeReferencePair<Element>): void {
this.#buildMaps(pair);

if (isMatchingElementPair(pair)) {
this.#buildMaps(pair);
this.#morphMatchingElementContent(pair);
} else {
throw new Error("You can only do an inner morph with matching elements.");
Expand Down

0 comments on commit 4f0ed50

Please sign in to comment.