From 674107516c13d50ffb98a7f79298d1d0b3561e59 Mon Sep 17 00:00:00 2001 From: Matt Dunn-Rankin Date: Tue, 19 May 2020 18:30:54 -0700 Subject: [PATCH] stop using `javascript:void 0` as a placeholder --- src/app/OutfitControls.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/OutfitControls.js b/src/app/OutfitControls.js index 19022ef..73c9897 100644 --- a/src/app/OutfitControls.js +++ b/src/app/OutfitControls.js @@ -135,7 +135,12 @@ function DownloadButton({ outfitState }) { aria-label="Download" as="a" // eslint-disable-next-line no-script-url - href={downloadImageUrl || "javascript:void 0"} + href={downloadImageUrl || "#"} + onClick={(e) => { + if (!downloadImageUrl) { + e.preventDefault(); + } + }} download={(outfitState.name || "Outfit") + ".png"} onMouseEnter={prepareDownload} onFocus={prepareDownload}