From 93b2034657d4e69aa4803941bfeb92f99eab5977 Mon Sep 17 00:00:00 2001 From: cstef Date: Sat, 15 Jun 2024 21:51:54 +0200 Subject: [PATCH] docs: fix copying code blocks only working one time --- docs/theme/book.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/theme/book.js b/docs/theme/book.js index d4c7c70..2477b53 100644 --- a/docs/theme/book.js +++ b/docs/theme/book.js @@ -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) {