Skip to content

rustdoc: run-button is scrolled together with code example #68337

Closed
@jfrimmel

Description

@jfrimmel

Currently rustdoc emits HTML/CSS for the official Rust std documentation, that includes Run-buttons, as shown below (current nightly documentation of std::string::String):
image, if the content is not scrolled
This works fine (although sometimes the Run-button might be above code), as long as the content of the code block is not scrollable horizontally.
If, on the other hand, the code block is scrollable horizontally, e.g. because the code shown has really long lines or the browser window is small, the Run button will be scrolled, too:
image with non-scrolled content
image with scrolled content and Run-button
I think the button is supposed to be in the top right hand corner and should stay there, even if the content is scrolled horizontally. I didn't notice similar behavior vertically as there is no "long enough" code example (which is good 😄)

I think, that a little CSS and possibly a change in the generated HTML should do the trick.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions