Skip to content

Commit

Permalink
fix: Slow click on conversion popup does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-c465 committed Aug 20, 2024
1 parent 53fff59 commit 4d9c4d6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const updateSearchBar = () => {
const targets = Array.from(targetElements);

for (const target of targets) {
target.onclick = () => {
target.onmousedown = () => {
convertToElement.value = target.dataset.value;
convertToInput.value = `${target.dataset.target} using ${target.dataset.converter}`;
showMatching("");
Expand All @@ -59,9 +59,7 @@ const updateSearchBar = () => {
// Keep the popup open even when clicking on a target button
// for a split second to allow the click to go through
if (e?.relatedTarget?.classList?.contains("target")) {
setTimeout(() => {
convertToPopup.hidden = true;
}, 100);
convertToPopup.hidden = true;
return;
}

Expand Down

0 comments on commit 4d9c4d6

Please sign in to comment.