Fix issues for custom elements
@@ -20,6 +20,7 @@ declare global {
/** Constructor for a custom element. */
export interface ElementConstructor {
new(): Element;
+ tagName: string;
}
const patchConfig: incrementaldom.PatchConfig = {
@@ -30,6 +31,9 @@ const patchConfig: incrementaldom.PatchConfig = {
matchNode instanceof Element) {
expectedNameOrCtor = matchNode.tagName.toLowerCase();
}
+ if (typeof nameOrCtor === 'function') {
+ nameOrCtor = (nameOrCtor as ElementConstructor).tagName;
+ }
return nameOrCtor === expectedNameOrCtor &&
isMatchingKey(proposedKey, currentPointerKey);
}
