From f73697c59be5c7f3bfd6ee9a9c039aabbe3fa054 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Sat, 16 May 2026 20:56:24 -0300 Subject: [PATCH] fix(sensor-panel): stop mousedown so the slider drags instead of panning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix opened the SensorControlPanel on a desktop sensor click during simulation, but the slider thumb still couldn't be dragged — the canvas pan handler claims any left mousedown that isn't explicitly stopped, so grabbing the slider was panning the canvas. The panel only stopped click events. We now stop mousedown and pointerdown on the panel wrapper as well, so input[type=range] gets its native drag and the pan handler stays out. --- .../src/components/simulator/SensorControlPanel.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/simulator/SensorControlPanel.tsx b/frontend/src/components/simulator/SensorControlPanel.tsx index 44ccd786..f7e97e6f 100644 --- a/frontend/src/components/simulator/SensorControlPanel.tsx +++ b/frontend/src/components/simulator/SensorControlPanel.tsx @@ -150,7 +150,15 @@ export const SensorControlPanel: React.FC = ({ }; return ( -
e.stopPropagation()}> +
e.stopPropagation()} + // The canvas treats left mousedown on empty space as a pan gesture. + // Without stopping mousedown here, dragging the lux/temp/etc. slider + // thumb pans the canvas instead of moving the slider. + onMouseDown={(e) => e.stopPropagation()} + onPointerDown={(e) => e.stopPropagation()} + >
{sensorName || def.title}