From f916c67d99ce794669ff9ef0440bd3b0e5a9edef Mon Sep 17 00:00:00 2001 From: MarvNC Date: Fri, 7 Jul 2023 16:13:22 -0700 Subject: [PATCH] Select textbox by default when opening add pack modal --- dist/index.css | 3 --- src/index.scss | 4 ---- src/renderer.js | 5 +++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dist/index.css b/dist/index.css index da6665d..a12d47d 100644 --- a/dist/index.css +++ b/dist/index.css @@ -402,9 +402,6 @@ body { color: var(--gray-color); opacity: 0.6; } -.modal-background .modal .inputbox input#add-sticker-input:focus::placeholder { - color: transparent; -} .modal-background .modal #add-sticker-button { background-color: var(--green-color); cursor: pointer; diff --git a/src/index.scss b/src/index.scss index c23ff60..8b42617 100644 --- a/src/index.scss +++ b/src/index.scss @@ -454,10 +454,6 @@ body { color: var(--gray-color); opacity: 0.6; } - - &:focus::placeholder { - color: transparent; - } } } diff --git a/src/renderer.js b/src/renderer.js index c677dc1..3261c3f 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -176,7 +176,7 @@ window.addEventListener('DOMContentLoaded', async () => { // Download sticker pack on add button const addButton = document.getElementById('add-button'); const addStickerModalBackground = document.getElementById('add-sticker-background'); - const input = document.getElementById('add-sticker-input'); + const addStickerInput = document.getElementById('add-sticker-input'); const addStickerButton = document.getElementById('add-sticker-button'); const lineURLRegex = /^https?:\/\/store\.line\.me\/stickershop\/product\/\d+(\/\w{2})?$/; @@ -193,6 +193,7 @@ window.addEventListener('DOMContentLoaded', async () => { addButton.addEventListener('click', async () => { addStickerModalBackground.style.display = 'block'; + addStickerInput.focus(); }); addStickerModalBackground.addEventListener('click', async (e) => { @@ -206,7 +207,7 @@ window.addEventListener('DOMContentLoaded', async () => { if (downloadActive) { return; } - const url = input.value; + const url = addStickerInput.value; if (!lineURLRegex.test(url)) { errorButton(addStickerButton); return;