Fix clicking on anchors inside summary tags.
This commit is contained in:
parent
c6a7ca196a
commit
04cb0dc8a9
2 changed files with 5 additions and 1 deletions
|
@ -888,7 +888,7 @@ function hideThemeButtonState() {
|
||||||
|
|
||||||
onEachLazy(document.querySelectorAll(".rustdoc-toggle > summary:not(.hideme)"), function(el) {
|
onEachLazy(document.querySelectorAll(".rustdoc-toggle > summary:not(.hideme)"), function(el) {
|
||||||
el.addEventListener("click", function(e) {
|
el.addEventListener("click", function(e) {
|
||||||
if (e.target.tagName != "SUMMARY") {
|
if (e.target.tagName != "SUMMARY" && e.target.tagName != "A") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,3 +6,7 @@ click: "h4.code-header" // This is the position of "pub" in "pub fn a_method"
|
||||||
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
|
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
|
||||||
click: ".impl-items .rustdoc-toggle summary::before" // This is the position of "[-]" next to that pub fn.
|
click: ".impl-items .rustdoc-toggle summary::before" // This is the position of "[-]" next to that pub fn.
|
||||||
assert-attribute-false: (".impl-items .rustdoc-toggle", {"open": ""})
|
assert-attribute-false: (".impl-items .rustdoc-toggle", {"open": ""})
|
||||||
|
|
||||||
|
// Click the "Trait" part of "impl Trait" and verify it navigates.
|
||||||
|
click: "#impl-Trait h3 a:first-of-type"
|
||||||
|
assert-text: (".fqn .in-band", "Trait lib2::Trait")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue