Help with alphabetized section list

#1

I’m trying to implement an alphabetized list with the scroll bar being the alphabet aligned vertically, where you can drag your finger up and down the alphabet scroll bar and it’ll scroll to the index of the list matching the letter (example).

I can’t seem to get it to scroll to the correct position, and I’m pretty sure that’s because I’m not handling the onLayout properly - how do I get the position of a letter based on the position on the screen?

My code: https://gist.github.com/prodigynelson/110dde0b537217d06043e58ba877cac5
Snack: https://snack.expo.io/By56O3ccM

#2

Hey @prodigynelson,

Getting an error when loading your snack.

#3

Fixed the snack link
Running the same exact code works locally, not sure why it’s not working in the snack :~(
Okay actually fixed the snack link https://snack.expo.io/By56O3ccM

closed #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.