Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollToLocation SectionList #30175

Closed
felire opened this issue Oct 14, 2020 · 2 comments
Closed

scrollToLocation SectionList #30175

felire opened this issue Oct 14, 2020 · 2 comments

Comments

@felire
Copy link

felire commented Oct 14, 2020

Description

Is it possible to scroll to a specific y position with the scrollToLocation method of a SectionList?

Can I do this:

ref.current.scrollToLocation({
animated: true,
itemIndex: 0,
sectionIndex: 0,
viewOffset: positionY
})

Where positionY could be a position on any section and any item of the entire SectionList

React Native version:

0.62.5

Is that going to work? Because I read an issue where some people where asking for an implementation of scrollTo or scrollToOffset

@felire
Copy link
Author

felire commented Oct 15, 2020

Okey I test it and it didn't work. Is there any way to scroll to specific y position on a SectionList ?

@felire
Copy link
Author

felire commented Oct 15, 2020

I will close it because it work doing:

              if (sectionList.getScrollResponder()) {
                sectionList.getScrollResponder().scrollTo({
                  animated: false,
                  y: positionY,
                });
              }

@felire felire closed this as completed Oct 15, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Oct 15, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants