Precise DOM morphing
morphing typescript dom

Limit the exact id match to matching elements

+1 -1
+1 -1
src/morphlex.ts
··· 298 298 if (id === "") continue 299 299 300 300 for (const candidate of candidates) { 301 - if (isElement(candidate) && id === candidate.id) { 301 + if (isElement(candidate) && node.localName === candidate.localName && id === candidate.id) { 302 302 matches.set(node, candidate) 303 303 unmatched.delete(node) 304 304 candidates.delete(candidate)