From 15852154c58796f0772d3d5075dbcc461d8d90c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 18 Jul 2022 23:44:37 +0200 Subject: [PATCH] Fix color picker closing on toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../features/soapbox_config/components/color-with-picker.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/soapbox_config/components/color-with-picker.tsx b/app/soapbox/features/soapbox_config/components/color-with-picker.tsx index 3fac5b9d2c..c82e1bf11e 100644 --- a/app/soapbox/features/soapbox_config/components/color-with-picker.tsx +++ b/app/soapbox/features/soapbox_config/components/color-with-picker.tsx @@ -28,12 +28,14 @@ const ColorWithPicker: React.FC = ({ buttonId, value, onChange setPlacement(isMobile(window.innerWidth) ? 'bottom' : 'right'); }; - const onToggle: React.MouseEventHandler = () => { + const onToggle: React.MouseEventHandler = (e) => { if (active) { hidePicker(); } else { showPicker(); } + + e.stopPropagation(); }; return (