From 23a8704b671fb8cb0f7fb577c60ea743288c57fc Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 21 Apr 2022 09:33:56 -0400 Subject: [PATCH] Text Panel: Fixes issue with hash anchor links (#47980) (#48055) --- public/app/core/navigation/patch/interceptLinkClicks.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/app/core/navigation/patch/interceptLinkClicks.ts b/public/app/core/navigation/patch/interceptLinkClicks.ts index f7381447e12..377a3413ab0 100644 --- a/public/app/core/navigation/patch/interceptLinkClicks.ts +++ b/public/app/core/navigation/patch/interceptLinkClicks.ts @@ -27,6 +27,10 @@ export function interceptLinkClicks(e: MouseEvent) { if (href.indexOf('://') > 0 || href.indexOf('mailto:') === 0) { window.location.href = href; return; + } else if (href.indexOf('#') === 0) { + // If it is a hash click, update the hash instead of trying to update the history + window.location.hash = href; + return; } else { href = `/${href}`; }