question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scrollview doesn't calculated header height while scrollTo function

See original GitHub issue

This 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:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
WoLewickicommented, Aug 11, 2020

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.

1reaction
ArekChrcommented, Aug 10, 2020

How to get large title header height to apply it as negative value of scrollTo?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found