Skip to content

Commit

Permalink
Switch to localName
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Feb 29, 2024
1 parent 465c875 commit ad01517
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/morphlex.js

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

4 changes: 2 additions & 2 deletions src/morphlex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Morph {
#morphNode(node: ChildNode, ref: ReadonlyNode<ChildNode>): void {
if (!(this.#options.beforeNodeMorphed?.({ node, referenceNode: ref as ChildNode }) ?? true)) return;

if (isElement(node) && isElement(ref) && node.tagName === ref.tagName) {
if (isElement(node) && isElement(ref) && node.localName === ref.localName) {
if (node.hasAttributes() || ref.hasAttributes()) this.#morphAttributes(node, ref);
if (isHead(node) && isHead(ref)) {
const refChildNodes: Map<string, ReadonlyNode<Element>> = new Map();
Expand Down Expand Up @@ -271,7 +271,7 @@ class Morph {
if (isElement(currentNode)) {
const id = currentNode.id;

if (!nextMatchByTagName && currentNode.tagName === ref.tagName) {
if (!nextMatchByTagName && currentNode.localName === ref.localName) {
nextMatchByTagName = currentNode;
}

Expand Down

0 comments on commit ad01517

Please sign in to comment.