From 9187859250b3e8535256e139b85f5dfe1ee64d6a Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 11:44:05 -0700 Subject: [PATCH] fix(docs): re-initialize search after Astro View Transitions (#712) Wraps DOM lookups and event listeners in initSearch() driven by astro:page-load event. Pagefind instance persists across navigations. Old event listeners torn down before re-attaching. Global keydown listener registered once via guard flag. Adds 2 Playwright regression tests for post-navigation search. Closes #712 Co-authored-by: CarlosSardo <5127825+CarlosSardo@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/src/components/Search.astro | 22 ++++----- docs/tests/search.spec.mjs | 77 +++++++++++++++----------------- 2 files changed, 48 insertions(+), 51 deletions(-) diff --git a/docs/src/components/Search.astro b/docs/src/components/Search.astro index 4524ce55b..c2ec77cc7 100644 --- a/docs/src/components/Search.astro +++ b/docs/src/components/Search.astro @@ -11,9 +11,9 @@ const base = import.meta.env.BASE_URL; - Search docs… + Search docsΓǪ - ⌘K + ΓîÿK @@ -30,7 +30,7 @@ const base = import.meta.env.BASE_URL; @@ -39,7 +39,7 @@ const base = import.meta.env.BASE_URL;