diff --git a/.gitignore b/.gitignore index ff829ba53..2ffbc1dce 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .tscache .baseDir.js .baseDir.ts +*.swp yarn.lock .nyc_output yarn-error.log diff --git a/src/lib/output/themes/default/assets/bootstrap.ts b/src/lib/output/themes/default/assets/bootstrap.ts index d090bff8f..d6dfc4765 100644 --- a/src/lib/output/themes/default/assets/bootstrap.ts +++ b/src/lib/output/themes/default/assets/bootstrap.ts @@ -19,3 +19,11 @@ if (themeChoice) { const app = new Application(); Object.defineProperty(window, "app", { value: app }); + +// Safari is broken and doesn't let you click on a link within +// a tag, so we have to manually handle clicks there. +document.querySelectorAll("summary a").forEach((el) => { + el.addEventListener("click", () => { + location.assign((el as HTMLAnchorElement).href); + }); +}); diff --git a/static/style.css b/static/style.css index 5b967176a..18b4f8fee 100644 --- a/static/style.css +++ b/static/style.css @@ -770,9 +770,11 @@ a.tsd-index-link { color: var(--color-text); } .tsd-accordion-summary { - list-style-type: none; - display: flex; - align-items: center; + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ } .tsd-accordion-summary, .tsd-accordion-summary a { @@ -784,7 +786,7 @@ a.tsd-index-link { cursor: pointer; } .tsd-accordion-summary a { - flex-grow: 1; + width: calc(100% - 1.5rem); } .tsd-accordion-summary > * { margin-top: 0;