Skip to content

Commit

Permalink
docs: fix copying code blocks only working one time
Browse files Browse the repository at this point in the history
  • Loading branch information
cestef committed Jun 15, 2024
1 parent ba3056d commit 93b2034
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/theme/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,11 @@ function playground_text(playground, hidden = true) {
});

clipboardSnippets.on("success", function (e) {
e.clearSelection();
showTooltip(e.trigger, "Copied!");
setTimeout(() => {
hideTooltip(e.trigger);
}, 1000);
e.clearSelection();
});

clipboardSnippets.on("error", function (e) {
Expand Down

0 comments on commit 93b2034

Please sign in to comment.