watermarkchurch / clc-app-v2

0 stars 1 forks source link

Schedule tab auto scroll not working on initial mount #104

Closed gburgett closed 2 years ago

gburgett commented 2 years ago

The initial scrollToLocation is somehow not invoking getItemLayout to find the right place in the list, and is instead just scrolling to the top. This happens only on initial mount, if the component is ever re-rendered (for example if a schedule item is updated) then it works properly (i think).

https://stackoverflow.com/questions/67440618/react-native-flatlist-scrolltoindex-is-not-working-when-screen-loaded-for-the

I think we need to set the initialScrollIndex property, but not sure exactly how to calculate that. SectionLists are hard.