From 12bb00eae15859dc56992a8c554150368e6dbda6 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Fri, 9 Jun 2023 18:57:31 +0200 Subject: [PATCH] fix(search): work around inline click handler (#1267) Preact, like most other popular frameworks disallows passing stringified JavaScript code as event handlers. We have one occurrence of that in our doc search. The recent addition of including `preact/debug` during server rendering in #1256 surfaced this problem. This PR works around that by injecting a tiny script tag that attaches the event handler. Basically only a slightly different approach than before. --- www/components/DocsSidebar.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/components/DocsSidebar.tsx b/www/components/DocsSidebar.tsx index 8bff7e54..bd86dd17 100644 --- a/www/components/DocsSidebar.tsx +++ b/www/components/DocsSidebar.tsx @@ -15,9 +15,15 @@ export default function DocsSidebar(props: { path: string; mobile?: boolean }) {