From d56e94ad09ad14912110f4456c09280b796f70ad Mon Sep 17 00:00:00 2001 From: Philip Peterson <1326208+philip-peterson@users.noreply.github.com> Date: Wed, 3 Jun 2026 01:54:48 -0700 Subject: [PATCH] Remove leftRef now that forceUpdate made it redundant Resize handler uses functional setLeft (no direct left read). onPointerDown uses left from render closure directly. Co-Authored-By: Claude Sonnet 4.6 --- .../custom/riverside_pt/js/components/rpt-testimonials.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/web/modules/custom/riverside_pt/js/components/rpt-testimonials.js b/web/modules/custom/riverside_pt/js/components/rpt-testimonials.js index 76e3856..1896a9e 100644 --- a/web/modules/custom/riverside_pt/js/components/rpt-testimonials.js +++ b/web/modules/custom/riverside_pt/js/components/rpt-testimonials.js @@ -55,9 +55,6 @@ function Testimonials() { setLeft(function (l) { return Math.max(-maxL, l - STEP); }); }; - var leftRef = useRef(left); - leftRef.current = left; - useEffect(function () { var timer; function onResize() { @@ -78,7 +75,7 @@ function Testimonials() { var drag = useRef(null); // null when idle, {x, left} when dragging var onPointerDown = function (e) { - drag.current = { x: e.clientX, left: leftRef.current }; + drag.current = { x: e.clientX, left: left }; trackRef.current.style.transition = "none"; e.currentTarget.setPointerCapture(e.pointerId); };