From b297690b3fc44806b3eb2f6751ce012301d2b700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= Date: Fri, 9 Sep 2022 09:59:53 +0200 Subject: [PATCH] js: fix anchor on tab selection (#68711) --- gadjo/static/js/gadjo.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gadjo/static/js/gadjo.js b/gadjo/static/js/gadjo.js index bc712f9..67f31fc 100644 --- a/gadjo/static/js/gadjo.js +++ b/gadjo/static/js/gadjo.js @@ -344,7 +344,8 @@ var gadjo_js = gadjo_js || {}; // Adjust URL to mention selected tab const url = new URL(document.location); - url.hash = '#open:' + btn.getAttribute('aria-controls').substring(6); + const prefix = btn.getAttribute('aria-controls').split('-')[0]; + url.hash = '#open:' + btn.getAttribute('aria-controls').substring(prefix.length + 1); history.replaceState(null, '', url); // Trigger gadjo:tab-selected event on panel