Skip to content

Commit aa4df10

Browse files
committed
fix(core/dom): fix push and insert error
1 parent 91f8930 commit aa4df10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/dom/dom-methods.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export function createMethods<ElementType extends ElementList>(
413413
clone?: boolean
414414
): PushReturn<T, ElementType> {
415415
// @ts-expect-error Check if el is FastjsDom | FastjsDomList
416-
el = el.el ? el : el.el();
416+
el = el.tagName ? el : el.el();
417417

418418
type IsReplace<T> = T extends "replaceElement" ? true : false;
419419
const isReplace = (target === "replaceElement") as IsReplace<T>;
@@ -505,7 +505,7 @@ export function createMethods<ElementType extends ElementList>(
505505
clone?: boolean
506506
): InsertReturn<ElementType> {
507507
// @ts-expect-error Check if el is FastjsDom | FastjsDomList
508-
el = el.el ? el : el.el();
508+
el = el.tagName ? el : el.el();
509509

510510
const newElement = createFastjsDom(clone ? el.cloneNode(true) : el);
511511
if (typeof target === "number") {

0 commit comments

Comments
 (0)