From 9b72b0bf9330c22a7553d2e119bcf840208ca7e6 Mon Sep 17 00:00:00 2001 From: Anthony Lieuallen Date: Mon, 21 Nov 2022 10:10:37 -0500 Subject: [PATCH] keep preview when clicking there --- colors.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/colors.html b/colors.html index d41fbb3..d802dfd 100644 --- a/colors.html +++ b/colors.html @@ -337,6 +337,9 @@ svg.addEventListener('mouseout', e => { document.body.addEventListener('click', e => { let el = e.target; + // Ignore clicks, i.e. to select, in the preview. + if (document.getElementById('preview').contains(el)) return; + // Remove possible forced stroke from previously-locked color. document.querySelectorAll('polygon[style]').forEach(el => { el.removeAttribute('style');