We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d63418 commit 670a78bCopy full SHA for 670a78b
src/librustdoc/html/static/js/main.js
@@ -1878,9 +1878,15 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
1878
if (elem === null) {
1879
return;
1880
}
1881
- const buttons = elem.querySelector(".button-holder");
+ let buttons = elem.querySelector(".button-holder");
1882
if (buttons === null) {
1883
- return;
+ // On mobile, you can't hover an element so buttons need to be created on click
1884
+ // if they're not already there.
1885
+ addCopyButton(event);
1886
+ buttons = elem.querySelector(".button-holder");
1887
+ if (buttons === null) {
1888
+ return;
1889
+ }
1890
1891
buttons.classList.toggle("keep-visible");
1892
0 commit comments