From 86413e6739a834f8490c2004a62a27d1f5a59d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=B5=E8=B0=A6?= Date: Wed, 31 Aug 2022 11:07:37 +0800 Subject: [PATCH] fix: prevent jumping on clicking docsearch action buttons (#1140) Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> --- src/client/app/router.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 23d002761f8..ef35f1c4e07 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -128,6 +128,10 @@ export function createRouter( window.addEventListener( 'click', (e) => { + // temporary fix for docsearch action buttons + const button = (e.target as Element).closest('button') + if (button) return + const link = (e.target as Element).closest('a') if (link) { const { href, origin, pathname, hash, search, target } = link