fix: falsy f-* attributes not preserved inside island (#2498)
Fixes https://github.com/denoland/fresh/issues/2359
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import "./polyfills.ts";
|
||||
import "./preact_hooks_client.ts";
|
||||
import "./partials.ts";
|
||||
export { asset, IS_BROWSER, Partial, type PartialProps } from "../shared.ts";
|
||||
export { boot, revive } from "./reviver.ts";
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
import { options } from "preact";
|
||||
import { assetHashingHook } from "../shared_internal.tsx";
|
||||
import { assetHashingHook, CLIENT_NAV_ATTR } from "../shared_internal.tsx";
|
||||
import { BUILD_ID } from "../build_id.ts";
|
||||
|
||||
const oldVNodeHook = options.vnode;
|
||||
options.vnode = (vnode) => {
|
||||
assetHashingHook(vnode, BUILD_ID);
|
||||
|
||||
if (typeof vnode.type === "string") {
|
||||
if (CLIENT_NAV_ATTR in vnode.props) {
|
||||
const value = vnode.props[CLIENT_NAV_ATTR];
|
||||
if (typeof value === "boolean") {
|
||||
vnode.props[CLIENT_NAV_ATTR] = String(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oldVNodeHook?.(vnode);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user