From efd513c9b75108ecfc724a4212c1204db30c5242 Mon Sep 17 00:00:00 2001 From: iyabong <68013311+iyabong@users.noreply.github.com> Date: Sun, 14 Sep 2025 02:53:33 +0900 Subject: [PATCH] =?UTF-8?q?"=ED=99=88=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=ED=85=9C=ED=94=8C=EB=A6=BF=20=EC=86=8C=EA=B0=9C"=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EB=8B=AB=EA=B8=B0=20=EA=B8=B0=EB=8A=A5(=ED=82=A4?= =?UTF-8?q?=EB=B3=B4=EB=93=9C=20=EC=82=AC=EC=9A=A9=EC=84=B1)=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Tab키로 'X'버튼 지정하여 닫기 가능하게 개선 2. Esc키로 닫기 가능하게 개선 --- src/js/ui.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/ui.js b/src/js/ui.js index 0319747..fe808b3 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -82,10 +82,18 @@ export default function initPage() { handleOpenPopup: function (e) { e.preventDefault(); this.$tg.style.display = "block"; + this.$tg.setAttribute("tabindex", "-1"); + this.$tg.focus({ preventScroll: true }); + this.$tg.addEventListener("keydown", this.handleEsc.bind(this)); }, handleClosePopup: function (e) { e.preventDefault(); this.$tg.style.display = "none"; + this.$tg.removeEventListener("keydown", this.handleEsc.bind(this)); + }, + handleEsc: function (e) { + if (e.key === "Escape") + this.handleClosePopup(e); }, }; document.querySelector(".lnk_go_template") && template.init();