fix: Slow click on conversion popup does not work
This commit is contained in:
parent
53fff594fc
commit
4d9c4d64aa
1 changed files with 2 additions and 4 deletions
|
|
@ -41,7 +41,7 @@ const updateSearchBar = () => {
|
||||||
const targets = Array.from(targetElements);
|
const targets = Array.from(targetElements);
|
||||||
|
|
||||||
for (const target of targets) {
|
for (const target of targets) {
|
||||||
target.onclick = () => {
|
target.onmousedown = () => {
|
||||||
convertToElement.value = target.dataset.value;
|
convertToElement.value = target.dataset.value;
|
||||||
convertToInput.value = `${target.dataset.target} using ${target.dataset.converter}`;
|
convertToInput.value = `${target.dataset.target} using ${target.dataset.converter}`;
|
||||||
showMatching("");
|
showMatching("");
|
||||||
|
|
@ -59,9 +59,7 @@ const updateSearchBar = () => {
|
||||||
// Keep the popup open even when clicking on a target button
|
// Keep the popup open even when clicking on a target button
|
||||||
// for a split second to allow the click to go through
|
// for a split second to allow the click to go through
|
||||||
if (e?.relatedTarget?.classList?.contains("target")) {
|
if (e?.relatedTarget?.classList?.contains("target")) {
|
||||||
setTimeout(() => {
|
|
||||||
convertToPopup.hidden = true;
|
convertToPopup.hidden = true;
|
||||||
}, 100);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue