fix: missing dom root frag polyfill after preact update (#2569)
This commit is contained in:
@@ -528,7 +528,7 @@ export function createRootFragment(
|
||||
endMarker: Text | Comment,
|
||||
): HTMLElement & { _frshRootFrag: boolean } {
|
||||
// @ts-ignore this is fine
|
||||
return {
|
||||
const rootFrag = {
|
||||
_frshRootFrag: true,
|
||||
nodeType: 1,
|
||||
parentNode: parent,
|
||||
@@ -562,6 +562,19 @@ export function createRootFragment(
|
||||
removeChild(child: Node) {
|
||||
parent.removeChild(child);
|
||||
},
|
||||
// deno-lint-ignore no-explicit-any
|
||||
} as any;
|
||||
contains(node: Node | null): boolean {
|
||||
if (node === null) return false;
|
||||
|
||||
const children = rootFrag.childNodes;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
if (children[i].contains(node)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
};
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
return rootFrag as any;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"lock": false,
|
||||
"nodeModulesDir": true,
|
||||
"tasks": {
|
||||
"start": "deno run -A --watch=static/,routes/,../src,../docs dev.ts",
|
||||
|
||||
Generated
+1418
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user