Fix bounce effect bug when switching view modes

This commit is contained in:
Lim Chee Aun 2023-06-29 10:08:31 +08:00
parent 8efc7a226e
commit c609ba0194

View file

@ -641,6 +641,14 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
} ${initialPageState.current === 'status' ? 'slide-in' : ''} ${
viewMode ? `deck-view-${viewMode}` : ''
}`}
onAnimationEnd={(e) => {
// Fix the bounce effect when switching viewMode
// `slide-in` animation kicks in when switching viewMode
if (initialPageState.current === 'status') {
// e.target.classList.remove('slide-in');
initialPageState.current = null;
}
}}
>
<header
class={`${heroInView ? 'inview' : ''} ${