Skip to content

Commit 2b03e48

Browse files
Clément VALENTINclaude
andcommitted
fix: corriger position fixed du HelpButton et cache IndexedDB
- PageTransition: supprimer transform apres animation pour que position:fixed fonctionne correctement (le transform CSS cree un nouveau containing block qui casse le positionnement fixed) - LoadingStatusBadge: tooltip adaptatif (meme largeur que le badge) - main.tsx: exclure energy-providers/offers de la persistence IndexedDB Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f989c02 commit 2b03e48

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

apps/web/src/components/PageTransition.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,30 @@ export function PageTransition({ children }: PageTransitionProps) {
2424
return () => cancelAnimationFrame(timer)
2525
}, [])
2626

27+
// After animation completes, remove transform entirely to avoid breaking position:fixed children
28+
// CSS transform creates a new containing block, which breaks fixed positioning
29+
const [animationComplete, setAnimationComplete] = useState(false)
30+
31+
useEffect(() => {
32+
if (isVisible) {
33+
// Wait for the 300ms transition to complete, then remove transform
34+
const timer = setTimeout(() => setAnimationComplete(true), 350)
35+
return () => clearTimeout(timer)
36+
}
37+
}, [isVisible])
38+
2739
return (
2840
<div
2941
className={`transition-all duration-300 ease-out ${
30-
isVisible
31-
? 'opacity-100 translate-y-0 scale-100'
32-
: 'opacity-0 translate-y-3 scale-[0.98]'
42+
animationComplete
43+
? 'opacity-100' // No transform after animation - fixes position:fixed for children
44+
: isVisible
45+
? 'opacity-100 translate-y-0 scale-100'
46+
: 'opacity-0 translate-y-3 scale-[0.98]'
3347
}`}
3448
style={{
3549
transformOrigin: 'top center',
36-
willChange: isVisible ? 'auto' : 'opacity, transform'
50+
willChange: animationComplete ? 'auto' : (isVisible ? 'auto' : 'opacity, transform')
3751
}}
3852
>
3953
{children}

0 commit comments

Comments
 (0)