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,
|
endMarker: Text | Comment,
|
||||||
): HTMLElement & { _frshRootFrag: boolean } {
|
): HTMLElement & { _frshRootFrag: boolean } {
|
||||||
// @ts-ignore this is fine
|
// @ts-ignore this is fine
|
||||||
return {
|
const rootFrag = {
|
||||||
_frshRootFrag: true,
|
_frshRootFrag: true,
|
||||||
nodeType: 1,
|
nodeType: 1,
|
||||||
parentNode: parent,
|
parentNode: parent,
|
||||||
@@ -562,6 +562,19 @@ export function createRootFragment(
|
|||||||
removeChild(child: Node) {
|
removeChild(child: Node) {
|
||||||
parent.removeChild(child);
|
parent.removeChild(child);
|
||||||
},
|
},
|
||||||
// deno-lint-ignore no-explicit-any
|
contains(node: Node | null): boolean {
|
||||||
} as any;
|
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,
|
"nodeModulesDir": true,
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --watch=static/,routes/,../src,../docs dev.ts",
|
"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