fix(cerveau): ancre d'échelle au téléphone, attendre l'hydratation du SwipeContainer
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWGVmz7YFJbqFQ8ZheNYQV
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
f78f620c64
commit
0bdff2c5f8
@@ -386,8 +386,11 @@ const categories = [
|
||||
if (!cle || !window.matchMedia('(max-width: 767px)').matches) return;
|
||||
const cible = document.querySelector<HTMLElement>(`[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);
|
||||
|
||||
Reference in New Issue
Block a user