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 <[email protected]>
  • Loading branch information
zonemeen and brc-dd authored 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
Original file line number Diff line number Diff line change
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.