From 8de6f0571ec2ad95a9c548776e04e3fc9b0535c7 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Mon, 3 Oct 2022 00:21:30 -0700 Subject: [PATCH] Fix double dialog when clicking on upload label Clicking an input's label is equal to clicking the input itself. So .stopPropagation() needs to be applied to the label as well as the input. --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 2d7a4d4..6f6d469 100644 --- a/index.html +++ b/index.html @@ -135,6 +135,7 @@ div.addEventListener('drop', e => input.files = e.dataTransfer.files); div.addEventListener('click', _ => input.click()); input.addEventListener('click', e => e.stopPropagation()); // Prevent 'click' from getting propagated to div (or else there will be two dialogs) + document.querySelector('label[for="file"]').addEventListener('click', e => e.stopPropagation()); // Implement namehash as defined in https://eips.ethereum.org/EIPS/eip-137 // Does NOT include the '0x' prefix in the return value so it can be easily passed into JSON-RPC -- 2.47.3