-
Notifications
You must be signed in to change notification settings - Fork 283
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 scroll super laggy on Android #751
Comments
Same issue |
I'm looking into this. |
@naqvitalha This ticket might be helpful to reference facebook/react-native#30034 |
@naqvitalha any luck tracking down the issue? |
@CaptainJeff What if we change this code to this code ( flatlist solution ): |
Yeah @devoren that's pretty much my current temporary solution. I was doing a patch-package on the react-native library for @naqvitalha maybe it makes sense to update this in the project? I just opened a PR #755 |
@CaptainJeff Does it work without this import in index.js |
@devoren yeah. Mine worked without that value |
@devoren Just to clarify. Are you setting that in the index.js of the root of your app? Not in this dependency, right? |
@CaptainJeff yes, index.js of the root of main app |
@CaptainJeff Flashlist lags again, but flat list works correctly |
It looks like the same issue as FlatList. I'll check the PR @CaptainJeff . Can you confirm it this fixes the issue completely? |
@naqvitalha It didn't help in my case, but if I use a flat list and add ViewReactNativeStyleAttributes in index.js it works correctly (without attribute inverted prop not working. Is ScaleY deprecated?) In any case, it lags on Android |
As a workaround before the fix is merged, I managed to work with the following patch file: diff --git a/dist/FlashList.js b/dist/FlashList.js
index c86f67d011fb509dcdc0998268cad1df3015b1e7..9f713c2be4a4a2f689fc350d88d4a77ca8bdbf16 100644
--- a/dist/FlashList.js
+++ b/dist/FlashList.js
@@ -23,7 +23,9 @@ var FlashList = /** @class */ (function (_super) {
var _a;
_this = _super.call(this, props) || this;
_this.listFixedDimensionSize = 0;
- _this.transformStyle = { transform: [{ scaleY: -1 }] };
+ _this.transformStyle = react_native_1.Platform.OS === "android"
+ ? { transform: [{ rotate: "180deg" }] }
+ : { transform: [{ scaleY: -1 }] };
_this.transformStyleHorizontal = { transform: [{ scaleX: -1 }] };
_this.distanceFromWindow = 0;
_this.contentStyle = {}; |
I'm using the following workarounds that seem to work fine for now. In my index.js:
flash-list patch:
|
Huge performance boost while scrolling after doing this especially with extreme long amount of multiples texts. |
Hi can someone tell me which better between |
@fukemy In my case "180 deg" works fine, try to measure performance on android |
@devoren thanks you, I am using |
With the current inverted list transforms, on Android, the scrollbar is inverted (on the left side, when it should be on the right). The upstream react-native patch (facebook/react-native@3dd816c) suggests that we should pass Perhaps we should add that to the inner ScrollView on |
I want to use a flashlist to show a inverted list. But if I use inverted prop on android it works very slow.
Default Flashlist: drops 5-10 FPS in dev mode (UI 60FPS)
Inverted Flashlist: drops 30-40 FPS in dev mode (UI also 20-40FPS)
Current behavior
inverted.webm
Expected behavior
UI 60 FPS
To Reproduce
The flatlist also has the same behavior but after using this patch UI stable 60fps but not working with FlashList
Platform:
Environment
1.4.1
The text was updated successfully, but these errors were encountered: