fix: prevent jumping on clicking docsearch action buttons (#1140)

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
pull/1268/head
灵谦 2 years ago committed by GitHub
parent 43c89d66c0
commit 86413e6739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save