Scrollview doesn't calculated header height while scrollTo function
See original GitHub issueThis error occurs in transparent headers, I tested it on a large title header when I call the function scrollRef.current.scrollTo({ x: 0, y: 0}) then it scroll content undertone header by y position of a header height. Scroll position Y at the beginning with expanded large header is -140 points, so I bet that is header height, and I can’t scrollTo({y: -140}) it also scroll under header. probably scroll position is incorrect (-140) with expanded large title header, workaround with scroll to negative y position doesn’t work.
- @react-navigation/native: 5.2.6
- @react-navigation/stack: 5.3.1
- react-native-screens: 2.780
platform: iOS
mode: Debug
Device: iPhone XS
OS version: 13.4.5
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
React Native ScrollView is not scrolling to the bottom sometimes
In order to bound the height of a ScrollView, either set the height of the view directly (discouraged) or make sure all parent...
Read more >ScrollView - React Native
In order to bound the height of a ScrollView, either set the height of the view directly (discouraged) or make sure all parent...
Read more >Common bugs in React Native ScrollView and how to fix them
React Native's ScrollView component is ubiquitous, but its implementation can sometimes lead to mistakes. Learn what to look out for here.
Read more >ScrollView - Android Developers
FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a RuntimeException...
Read more >Window scrollTo() Method - W3Schools
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My bad then. It seems that on the bigger phones it is 140 due to notch. You can look at this thread to see updates on exposing the header’s height: https://github.com/software-mansion/react-native-screens/issues/430.
How to get large title header height to apply it as negative value of
scrollTo
?