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

the scrollToEnd / scrollToOffset methods of FlatList execute unexpected if set ListHeaderComponent prop #15804

Closed
kid-wumeng opened this issue Sep 5, 2017 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@kid-wumeng
Copy link

kid-wumeng commented Sep 5, 2017

Hi, good people... thanks your contributions for react-native, the amazing framework.

Now... I happen the issue, very headache...

react-native version: 0.47.1

Example, render the FlatList like this:

<FlatList
  ref="flatlist"
  ListHeaderComponent={one header component...}
/>

Maybe, the header component has a height such as 300.

When i execute scrollToEnd methods, i hope the list scroll to end, and the scroll distance should includes the header height (now 300).

But, it will scroll unexpected. the list will scroll to an uncertain position.

Based on my observation, it seemingly did not computed and included the header height.

Whether this is a bug or not ? How can i solve it in current version ?

@kid-wumeng kid-wumeng changed the title the scrollToEnd / scrollToOffset methods of FlatList execute unexpected the scrollToEnd / scrollToOffset methods of FlatList execute unexpected if set ListHeaderComponent prop Sep 5, 2017
@hramos
Copy link
Contributor

hramos commented Sep 5, 2017

Hey, thanks for reporting this issue!

It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.

I am going to close this, but feel free to open a new issue that meets the requirements set forth in the template. Thanks!

@hramos hramos closed this as completed Sep 5, 2017
@adamterlson
Copy link
Contributor

adamterlson commented Mar 16, 2018

I also suffered from this issue, and was able to work around it by accessing the scrollResponder directly:

    this.listRef.getScrollResponder().scrollResponderScrollToEnd({
      animated: true,
    });

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

No branches or pull requests

4 participants