From 0bdff2c5f8cbee7808d7d007f3c4a13ed9bd76ee Mon Sep 17 00:00:00 2001 From: Jules Neny Date: Sat, 7 Nov 2026 20:51:29 +0100 Subject: [PATCH] =?UTF-8?q?fix(cerveau):=20ancre=20d'=C3=A9chelle=20au=20t?= =?UTF-8?q?=C3=A9l=C3=A9phone,=20attendre=20l'hydratation=20du=20SwipeCont?= =?UTF-8?q?ainer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recette 390 : #echelle-m restait sur le panneau central, le SwipeContainer (client:load) s'hydratait après l'événement load. Petit délai avant de ramener le panneau gauche puis de faire défiler jusqu'à la cible. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01PWGVmz7YFJbqFQ8ZheNYQV --- src/components/astro/ColJournal.astro | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/astro/ColJournal.astro b/src/components/astro/ColJournal.astro index bab4ad6..c50ec13 100644 --- a/src/components/astro/ColJournal.astro +++ b/src/components/astro/ColJournal.astro @@ -386,8 +386,11 @@ const categories = [ if (!cle || !window.matchMedia('(max-width: 767px)').matches) return; const cible = document.querySelector(`[data-ancre="${CSS.escape(cle)}"]`); if (!cible) return; - document.dispatchEvent(new CustomEvent('mobile-tab-scroll', { detail: { pos: 0 } })); - setTimeout(() => cible.scrollIntoView({ block: 'start' }), 350); + // Le SwipeContainer (client:load) peut s'hydrater après l'événement load : on lui laisse un instant. + setTimeout(() => { + document.dispatchEvent(new CustomEvent('mobile-tab-scroll', { detail: { pos: 0 } })); + setTimeout(() => cible.scrollIntoView({ block: 'start' }), 400); + }, 300); }; window.addEventListener('load', suivreAncreTelephone); window.addEventListener('hashchange', suivreAncreTelephone);