From 898d21d1b221576b7506a56eaf75bc8f680df233 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 5 Dec 2024 17:25:02 -0500 Subject: [PATCH] Small tweak to nohover to only start timeout on requestanimationframe (#1398) --- frontend/wave.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/wave.ts b/frontend/wave.ts index c296de862..497bbae12 100644 --- a/frontend/wave.ts +++ b/frontend/wave.ts @@ -92,9 +92,11 @@ async function reinitWave() { // We use this hack to prevent a flicker of the previously-hovered tab when this view was last active. This class is set in setActiveTab in global.ts. See tab.scss for where this class is used. // Also overrides the staticTabAtom to the new tab id so that the active tab is set correctly. globalStore.set(overrideStaticTabAtom, savedInitOpts.tabId); - setTimeout(() => { - document.body.classList.remove("nohover"); - }, 100); + requestAnimationFrame(() => + setTimeout(() => { + document.body.classList.remove("nohover"); + }, 100) + ); const client = await WOS.reloadWaveObject(WOS.makeORef("client", savedInitOpts.clientId)); const waveWindow = await WOS.reloadWaveObject(WOS.makeORef("window", savedInitOpts.windowId));