Skip to content

Commit

Permalink
Merge pull request #33 from MarvNC/23-select-textbox-by-default-when-…
Browse files Browse the repository at this point in the history
…opening-add-pack-modal

Select textbox by default when opening add pack modal
  • Loading branch information
MarvNC authored Jul 7, 2023
2 parents f9afd64 + f916c67 commit 89a830e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
3 changes: 0 additions & 3 deletions dist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,6 @@ body {
color: var(--gray-color);
opacity: 0.6;
}

&:focus::placeholder {
color: transparent;
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})?$/;

Expand All @@ -193,6 +193,7 @@ window.addEventListener('DOMContentLoaded', async () => {

addButton.addEventListener('click', async () => {
addStickerModalBackground.style.display = 'block';
addStickerInput.focus();
});

addStickerModalBackground.addEventListener('click', async (e) => {
Expand All @@ -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;
Expand Down

0 comments on commit 89a830e

Please sign in to comment.