fix: prevent anchor link from being a link
This commit is contained in:
parent
720b636439
commit
b119861eee
@ -87,7 +87,7 @@ internal sealed class CodeSnippetTemplateRenderer : CustomTemplateRenderer
|
|||||||
data-tab-init
|
data-tab-init
|
||||||
class="nav-link{classList}"
|
class="nav-link{classList}"
|
||||||
id="snp-{snippetId}-{identifier:N}-{language}-l"
|
id="snp-{snippetId}-{identifier:N}-{language}-l"
|
||||||
href="#snp-{snippetId}-{identifier:N}-{language}"
|
href="#"
|
||||||
role="tab"
|
role="tab"
|
||||||
data-tabs="snp-{snippetId}-{identifier:N}"
|
data-tabs="snp-{snippetId}-{identifier:N}"
|
||||||
aria-controls="snp-{snippetId}-{identifier:N}-{language}"
|
aria-controls="snp-{snippetId}-{identifier:N}-{language}"
|
||||||
|
@ -159,7 +159,9 @@ class UI {
|
|||||||
const tabPanes = element.querySelectorAll(`.tab-pane[data-identifier="${identifier}"]`);
|
const tabPanes = element.querySelectorAll(`.tab-pane[data-identifier="${identifier}"]`);
|
||||||
|
|
||||||
tabLinks.forEach(function (tabLink: Element) {
|
tabLinks.forEach(function (tabLink: Element) {
|
||||||
tabLink.addEventListener("click", () => {
|
tabLink.addEventListener("click", (ev: Event) => {
|
||||||
|
ev.preventDefault();
|
||||||
|
|
||||||
const controls = document.getElementById(tabLink.getAttribute("aria-controls"));
|
const controls = document.getElementById(tabLink.getAttribute("aria-controls"));
|
||||||
|
|
||||||
// switch "active" tab link
|
// switch "active" tab link
|
||||||
|
Loading…
Reference in New Issue
Block a user