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

Actions.refresh should also reset screen position? #3152

Closed
dextermb opened this issue Jul 30, 2018 · 1 comment
Closed

Actions.refresh should also reset screen position? #3152

dextermb opened this issue Jul 30, 2018 · 1 comment

Comments

@dextermb
Copy link
Contributor

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.27
  • react-native v0.54.0

Expected behaviour

When calling Actions.refresh() screen position should be reset to the top of the screen

Actual behaviour

The screen currently stays where it was before refresh

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.

  1. Add a scene
  2. Call Actions.refresh()
  3. Screen position will not reset
@dextermb
Copy link
Contributor Author

I guess this isn't possible without having a ref to the ScrollView unless you were to loop through elements in a component recursively.

Note that this can be done like so:

<ScrollView ref={ref => this.scroll_view = ref}/>
scrollToTop() {
     this.scroll_view.scrollTo({ y: 0 });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant