From ffd9e76e07c2870b59b32f92fbb44afd8e351b4a Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 30 Aug 2021 01:11:00 +0200 Subject: [PATCH] select all text in modal.prompt --- copyparty/web/util.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 4ded878f..a6646d52 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -782,7 +782,13 @@ var modal = (function () { a = ebi('modal-ok'); a.onclick = ok; - (ebi('modali') || a).focus(); + var inp = ebi('modali'); + (inp || a).focus(); + if (inp) + setTimeout(function () { + inp.setSelectionRange(0, inp.value.length, "forward"); + }, 0); + document.addEventListener('focus', onfocus); timer.add(onfocus); };