From 514d6597cf4707d0669db9328f1d0ad65eaff79d Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Thu, 16 Jul 2026 05:31:12 +0200 Subject: [PATCH] vfd --- public/s/js/sidebar-activity.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/s/js/sidebar-activity.js b/public/s/js/sidebar-activity.js index 67c84d4..0ebd80f 100644 --- a/public/s/js/sidebar-activity.js +++ b/public/s/js/sidebar-activity.js @@ -611,7 +611,12 @@ container.appendChild(ioSentinel); } attachMediaLoadListeners(container); - checkOverflow(); + // Defer overflow check until after the browser has performed layout on the + // newly-injected innerHTML — a synchronous call here fires before paint so + // scrollHeight === clientHeight, causing has-overflow to be stripped and the + // "read more" button to flash away. Double-rAF guarantees we measure after + // the first layout/paint cycle. + requestAnimationFrame(() => requestAnimationFrame(() => checkOverflow())); fetchSidebarYoutubeTitles(container); // Auto-play converted GIF videos and webm emoji stickers container.querySelectorAll('video.autoplay-gif').forEach(v => { v.autoplay = true; v.muted = true; v.play().catch(() => { v.addEventListener('canplay', () => v.play().catch(() => { }), { once: true }); }); });