From ffe0c40ebc42d7769b5378775cdffcab52d3cf11 Mon Sep 17 00:00:00 2001 From: Guanghui Cheng Date: Tue, 22 Feb 2022 10:04:26 +0800 Subject: [PATCH] fix(client router): tolerant invalid hash selector typo (#506) --- src/client/app/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 49f191a08ddd..f7c2a3973af3 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -198,7 +198,7 @@ function scrollTo(el: HTMLElement, hash: string, smooth = false) { let target: Element | null = null try { - target = el.classList.contains('.header-anchor') + target = el.classList.contains('header-anchor') ? el : document.querySelector(decodeURIComponent(hash)) } catch (e) {