-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Inverted FlatList doesn't work on Android P #19434
Comments
For anyone else running into this issue, I could also suggest looking into this library: https://github.com/godness84/react-native-recyclerview-list
|
Reproducible on release version of Android P |
Reproducible also on native android app (example), with so it may be a native issue, and possibly related to this: |
@arendjr that recyclerview-list looks amazing, are you aware of a similar project for iOS? |
@enahum No sorry, the catch is indeed it's Android-only. I haven't really looked for iOS counterparts though. Ideally I'd still hope this behavior gets properly fixed in |
So I've been digging into this a bit more and have landed on this line: react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java Line 265 in 8f7372f
Seems that the |
@jarredwitt Any luck getting to the bottom of this? |
I'd appreciate any help on this 🙇 |
Opened an issue for Android, since it happens in native apps with |
Our temp solution was to natively inherite
|
I used a similar workaround to @Rongrs by checking this.getScaleY() < 0 and Build.VERSION in
|
@krishom is this working well for you? I'm trying to test out your code, but can't get it to work. |
@jarredwitt Yeah, my fix is working on a Pixel 2 running Android P. The ScrollView lives in a |
@krishom interesting. Actually debugging right now and can't get |
@jarredwitt build.gradle: |
A workaround that works for us that's far simpler but may not be a viable option for everyone: don't use |
Just tested locally with Will try to have someone from the core take a closer look at this since it's something that I fear in a couple months will affect a good portion of Pixel users. cc @dulmandakh |
@kelset I tried to make a workaround as safe as possible and w/o having to check for a build number: https://github.com/facebook/react-native/pull/21117/files I will be happy to hear your feedback! |
@Rongrs @jarredwitt @krishom Could you please explain, how are you using overridden ReactScrollView.java class with your app? Are you creating a custom build of react-native .aar file? |
Any news on this from the react native team side? |
How to apply the changes made for this files? |
@roylabanon the easiest way is to use a fork of React Native and apply the patch there. Having a fork might be useful for other things as well (let's say you need to expose a property that RN doesn't expose by default, etc). |
Hi Igor, thanks for the reply, but I'm kind of a newbie in this stuffs, you
got a good step-by-step guide to help me out? Basically i tried to apply
this fix, but it doesn't seem to take effect, so wondering what needs to be
done. Thanks so much.
…On Tue, Oct 9, 2018 at 4:38 PM Igor Mandrigin ***@***.***> wrote:
@roylabanon <https://github.com/roylabanon> the easiest way is to use a
fork of React Native and apply the patch there.
Having a fork might be useful for other things as well (let's say you need
to expose a property that RN doesn't expose by default, etc).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19434 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANd1uLiuyCwrBfmHZRIMIMkoQ-jMcdZhks5ujGCAgaJpZM4UMcR9>
.
|
@roylabanon You need to build react-native from source in order to make any android changes take effect. Maintaining a fork of react-native isn't as trivial as forking the github repo and commiting your local changes. It always involves an additional building step, at least for android. Good luck. |
@roylabanon it isn't super trivial, but that is how we did it. Note, that apart from that you will need to setup your dev environment (install Android NDK, etc), but that is very well described in the official docs (as @johakr mentioned). |
Great thanks so much guys |
Is there any chance of this PR being merged before the next release? |
Following also have this problem 👍 |
hey sorry, I completely missed all notifications about this lately 🤦♂️ I'll double check the PR and we'll try to get it in asap (but probably won't be next patch for 0.57.x, we'll see - if not it will be in the one after that). |
Thanks @kelset - this effect all chat apps and anything that uses |
Did this fix land in 0.57.5? The PR #21117 was merged right before the release but I'm crossing my fingers that maybe somehow it sneaked in... |
@kelset will be able to tell you if it landed |
@scottmas you can check the changelog to know which commits landed and which not. You can also suggest commits that landed to be cherry picked in the dedicated issue - in particular, this commit has already been requested. |
Nope, this fix didnt make into 0.57.3. |
@ilevator latest version is 0.57.5 |
…d P (#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes #19434 Pull Request resolved: #21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
0.57.7 looks like fixed! |
…d P (facebook#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes facebook#19434 Pull Request resolved: facebook#21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
…d P (facebook#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes facebook#19434 Pull Request resolved: facebook#21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
…d P (facebook#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes facebook#19434 Pull Request resolved: facebook#21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
When using FlatList with
inverted={true}
the scrolling doesn't work as expected.it seems that the momentum is not inverted, and at the end of the scroll - the momentum takes it back to the other side
Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 8.11.1
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4670197
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: ~0.55.2 => 0.55.4
Steps to Reproduce
With Android P public beta installed -
https://snack.expo.io/BklXgV8Nk7
Expected Behavior
scrolling will work as usual
Actual Behavior
momentum is inverted
The text was updated successfully, but these errors were encountered: