diff --git a/packages/core/src/dom/dom-methods.ts b/packages/core/src/dom/dom-methods.ts index 03861f84e..1c5feaaf3 100644 --- a/packages/core/src/dom/dom-methods.ts +++ b/packages/core/src/dom/dom-methods.ts @@ -413,7 +413,7 @@ export function createMethods( clone?: boolean ): PushReturn { // @ts-expect-error Check if el is FastjsDom | FastjsDomList - el = el.el ? el : el.el(); + el = el.tagName ? el : el.el(); type IsReplace = T extends "replaceElement" ? true : false; const isReplace = (target === "replaceElement") as IsReplace; @@ -505,7 +505,7 @@ export function createMethods( clone?: boolean ): InsertReturn { // @ts-expect-error Check if el is FastjsDom | FastjsDomList - el = el.el ? el : el.el(); + el = el.tagName ? el : el.el(); const newElement = createFastjsDom(clone ? el.cloneNode(true) : el); if (typeof target === "number") {