-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[ScollView/ListView] contentOffsets, contentInsets strange behavior #1641
Comments
Would it be possible to replicate this on https://rnplay.org? |
@jtremback SUPER frustratingly, this seems to work just the way I'd expect (https://rnplay.org/apps/nWGxtw) However, in my project, of course it does not work that way. See my updated first post. |
@marcshilling What version of react-native are you running? |
@jtremback I'm on the master branch...0.6.0 |
@jtremback - that simulator is on 0.5.0 (see the header bar) |
Is this related to my issue? #1779 |
Seems like #2151 might be related. |
👍 |
1 similar comment
👍 |
@ide @brentvatne Can be closed. Solution provided in related issues. |
I am trying to make a simple ListView which has a search bar header that is hidden behind the nav bar by default, but upon scrolling you can reveal it (a pretty standard iOS interaction). Has anyone had success with this? I am seeing some pretty strange behavior.
Here is my ListView setup. The list view is behind both a nav bar and a tab bar (hence the content insets):
The "strange behavior" I mention is that the "contentOffset" prop (which I believe is how this should be accomplished) seems to have no effect upon this view first appearing. I can set that Y value to anything and the view looks the same when it is presented (the search bar is displayed at the top). However, if I change that Y value and save, the simulator live reloads and seems to adjust the offset properly.
UPDATE:
I've found a really dumb, hacky way of getting around this:
If in
componentDidMount
I do this:And render ListView's
contentOffset
like so:Then, the search bar is correctly hidden upon the view appearing.
Because of that ^, I'm lead to believe there HAS to be a bug here.
The text was updated successfully, but these errors were encountered: