From 40eb23dc9bb906175210462195a78ca35b935e42 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Wed, 21 May 2025 22:02:49 +0100 Subject: [PATCH] Trim whitespace when copying to clipboard --- assets/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/app.js b/assets/js/app.js index c3e2eb92..1fcc4ec6 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -51,7 +51,7 @@ window.addEventListener("phx:page-loading-start", (_info) => topbar.show(300)); window.addEventListener("phx:page-loading-stop", (_info) => topbar.hide()); window.addEventListener("music_library:clipcopy", (event) => { if ("clipboard" in navigator) { - const text = event.target.textContent; + const text = event.target.textContent.trim(); navigator.clipboard.writeText(text); } else { alert("Sorry, your browser does not support clipboard copy.");