From 186c5353d4323e7cd097544480fb1fcfae49b2a9 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Sat, 25 Jul 2026 09:33:11 +0700 Subject: [PATCH] fix: tempo lane DOM scrollLeft traversal finds overflow-x:auto parent --- app/static/js/app.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/static/js/app.jsx b/app/static/js/app.jsx index 0ce5f70..8c689da 100644 --- a/app/static/js/app.jsx +++ b/app/static/js/app.jsx @@ -1207,11 +1207,12 @@ const TempoTrackLane = ({ const ctx = canvas.getContext('2d'); const dpr = window.devicePixelRatio || 1; let el = canvas.parentElement; - for (let i = 0; i < 4 && el; i++) { - if (el.scrollWidth > el.clientWidth || getComputedStyle(el).overflowX === 'auto' || getComputedStyle(el).overflowX === 'scroll') break; + while (el) { + const ox = getComputedStyle(el).overflowX; + if (ox === 'auto' || ox === 'scroll') break; el = el.parentElement; } - const scrollLeftVal = el && el.scrollWidth > el.clientWidth ? el.scrollLeft : (scrollLeft || 0); + const scrollLeftVal = el ? el.scrollLeft : (scrollLeft || 0); const height = canvas.parentElement ? canvas.parentElement.clientHeight : 40; canvas.width = Math.min(Math.round(drawWidth * dpr), 32768); canvas.height = Math.min(Math.round(height * dpr), 32768);