From dfad17973670f2df5310ebae5268ea49b013626d Mon Sep 17 00:00:00 2001 From: lostdusty <47502554+lostdusty@users.noreply.github.com> Date: Fri, 7 Jun 2024 01:02:36 -0300 Subject: [PATCH] front: autofocus entry, enter close popups --- src/front/cobalt.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/front/cobalt.js b/src/front/cobalt.js index 0c89dec2..0b40be46 100644 --- a/src/front/cobalt.js +++ b/src/front/cobalt.js @@ -650,6 +650,7 @@ window.onload = () => { changeDownloadButton("hidden"); eid("url-input-area").value = ""; + if (isIOS) { sSet("downloadPopup", "true"); @@ -670,6 +671,7 @@ window.onload = () => { if (isIOS) { document.addEventListener('touchstart', () => {}, true); } + eid("url-input-area").focus(); } eid("url-input-area").addEventListener("keydown", () => { @@ -703,6 +705,6 @@ document.onkeydown = (e) => { if (e.key === "M") popup('settings', 1); } else { - if (e.key === "Escape") hideAllPopups(); + if (e.key === "Escape" || e.key === "Enter") hideAllPopups(); } }