Closed
Description
Steps to reproduce the issue:
- In any Rust project, create a new documentation website and open it:
cargo doc --open
- Make sure you're viewing the page on a device with a screen width greater than 700px. Click the "help" icon on the top right to open the help popover:
- Click the anchor link "the rustdoc book"
Expected result: I am able to follow the anchor link, and the tab is redirected to the https://doc.rust-lang.org/rustdoc/ site
Actual result: nothing happens
It looks like the issue is happening due to L1043-L1045 in src/librustdoc/html/static/js/main.js
:
container.onclick = event => {
event.preventDefault();
};
Where container
is the popover <div>
element, which the click event on the child <a>
element bubbles up to. I tested deleting this event listener directly within the browser and it appears to fix the issue.
I don't think deleting this event listener would cause any regressions because there is already no default behavior when you click on a plain <div>
. However, I'm not sure what the full context was around adding this event listener in the first place.