diff --git a/examples/notes/src/components/EditButton.tsx b/examples/notes/src/components/EditButton.tsx index 30c16e446..e4f780664 100644 --- a/examples/notes/src/components/EditButton.tsx +++ b/examples/notes/src/components/EditButton.tsx @@ -6,12 +6,14 @@ * */ import type { JSX } from "@solidjs/web"; +import { useSearchLink } from "~/lib/links"; export default function EditButton(props: { noteId?: number; children: JSX.Element }) { + const searchLink = useSearchLink(); const isDraft = !("noteId" in props); return ( diff --git a/examples/notes/src/components/SidebarNoteContent.tsx b/examples/notes/src/components/SidebarNoteContent.tsx index 174e6747c..20ba2bff6 100644 --- a/examples/notes/src/components/SidebarNoteContent.tsx +++ b/examples/notes/src/components/SidebarNoteContent.tsx @@ -14,6 +14,7 @@ import { useLocation } from "@solidjs/router"; import { createEffect, createSignal, Show } from "solid-js"; import type { JSX } from "@solidjs/web"; +import { useSearchLink } from "~/lib/links"; export default function SidebarNoteContent(props: { id: number; @@ -22,6 +23,7 @@ export default function SidebarNoteContent(props: { expandedChildren: JSX.Element; }) { const location = useLocation(); + const searchLink = useSearchLink(); const [isExpanded, setIsExpanded] = createSignal(false); const isActive = () => location.pathname.startsWith(`/notes/${props.id}`); let itemRef!: HTMLDivElement; @@ -48,7 +50,7 @@ export default function SidebarNoteContent(props: { > {props.children} { + const searchText = location.query.searchText; + return searchText ? `${path}?searchText=${encodeURIComponent(String(searchText))}` : path; + }; +} diff --git a/packages/solid-web/frames/src/client.ts b/packages/solid-web/frames/src/client.ts index a35020719..8fc135474 100644 --- a/packages/solid-web/frames/src/client.ts +++ b/packages/solid-web/frames/src/client.ts @@ -145,6 +145,12 @@ function claimRender(prefix: string, existing: Node[], render: () => any) { const prevRegistry = sc.registry; const prevHydrating = sc.hydrating; const prevClaimRoots = sc.claimRoots; + // The enclosing pass gathered these same nodes: gatherHydratable sweeps the + // whole document for `_hk`, frame regions included, so every slot root ends + // up in the root registry too. Only this scoped registry ever claims them, + // so hand ownership over — otherwise the root's completion check reports + // each claimed slot node as unclaimed server markup. + if (prevRegistry) for (const key of registry.keys()) prevRegistry.delete(key); sc.registry = registry; sc.hydrating = true; // The range may be DETACHED right now (an async slot fill renders before