Skip to content

Commit

Permalink
fix: prevent jumping on clicking docsearch action buttons (#1140)
Browse files Browse the repository at this point in the history
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
zonemeen and brc-dd committed Aug 31, 2022
1 parent 43c89d6 commit 86413e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client/app/router.ts
Expand Up @@ -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
Expand Down

0 comments on commit 86413e6

Please sign in to comment.