From 1a9b2cd26381ac26e345d944fe69abd2f67c4867 Mon Sep 17 00:00:00 2001 From: tangimds Date: Tue, 31 May 2022 20:40:41 +0200 Subject: [PATCH] fix: scroll to top --- src/scenes/diary/index.js | 7 +------ src/scenes/status/index.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/scenes/diary/index.js b/src/scenes/diary/index.js index c03f5800..a3d17a0d 100644 --- a/src/scenes/diary/index.js +++ b/src/scenes/diary/index.js @@ -61,11 +61,6 @@ const Diary = ({ navigation, hideDeader = false }) => { return ( setNPSvisible(false)} /> - {!hideDeader ? ( - -
- - ) : null} { const [page, setPage] = useState(1); const [bannerProNPSVisible, setBannerProNPSVisible] = useState(true); const [ongletActif, setOngletActif] = useState("all"); + const scrollRef = React.useRef(); + + React.useEffect(() => { + scrollRef.current.scrollTo({ + y: 0, + animated: false, + }); + }, [ongletActif]); // **************** // BEGIN - MASQUAGE DU HEADER AU SCROLL @@ -181,6 +189,9 @@ const Status = ({ navigation, startSurvey }) => { ) : ( <>