From 655655cb518704fb166f67c91be26e3bf8fd8a45 Mon Sep 17 00:00:00 2001 From: Jordan Bradford <36420801+jrdnbradford@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:49:14 -0400 Subject: [PATCH] Use `select()` --- docs/_static/link_gen/link.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/_static/link_gen/link.js b/docs/_static/link_gen/link.js index 3a054a0..3dd0dab 100644 --- a/docs/_static/link_gen/link.js +++ b/docs/_static/link_gen/link.js @@ -286,6 +286,7 @@ function linkMain() { function copyLink(elementId) { var copyText = document.getElementById(elementId); - copyText.focus(); + copyText.select(); + copyText.setSelectionRange(0, copyText.value.length); navigator.clipboard.writeText(copyText.value); }