Skip to content

Commit 838e742

Browse files
rustdoc: Fix links in trait impl docs
1 parent b105556 commit 838e742

File tree

1 file changed

+3
-1
lines changed
  • src/librustdoc/html/static/js

1 file changed

+3
-1
lines changed

src/librustdoc/html/static/js/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,8 +1179,10 @@ function preLoadCss(cssUrl) {
11791179

11801180
onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"), el => {
11811181
// @ts-expect-error
1182+
// Clicking on the summary's contents should not collapse it,
1183+
// but links within should still fire.
11821184
el.addEventListener("click", e => {
1183-
if (e.target.tagName !== "SUMMARY" && e.target.tagName !== "A") {
1185+
if (!e.target.matches("summary, a, a *")) {
11841186
e.preventDefault();
11851187
}
11861188
});

0 commit comments

Comments
 (0)