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

Android - Flatlist with inverted horizontal on scroll goes back to the start #22710

Closed
tamirrab opened this issue Dec 19, 2018 · 14 comments
Closed
Labels
Bug Component: FlatList Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@tamirrab
Copy link

Environment

React Native Environment Info:
System:
OS: macOS 10.14.2
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 2.24 GB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.4 - ~/.nvm/versions/node/v8.11.4/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.11.4/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 26, 27, 28
Build Tools: 27.0.3, 28.0.2, 28.0.3
System Images: android-24 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: ^16.6.3 => 16.6.3
react-native: 0.58.0-rc.1 => 0.58.0-rc.1
npmGlobalPackages:
react-native-git-upgrade: 0.2.7

Description

When using Flatlist on Android (I try on android pie 9) and add "inverted" and "horizontal" and scrolling fast to the right (from start to end) - the Flatlist scroll back to the other side (to the left)

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve

@tamirrab tamirrab changed the title Flatlist with inverted horizontal on scroll goes back to the start Android - Flatlist with inverted horizontal on scroll goes back to the start Dec 19, 2018
@sramezani
Copy link

sramezani commented Dec 24, 2018

+1
I have same problem with Android 9 ( inverted horizontal Flatlist )

react: 16.6.3
react-native: 0.57.8

@OmarBasem
Copy link

I am having the same problem, react native 0.57.8 , react 16.6.3

@zth
Copy link

zth commented Jan 10, 2019

Same problem here. I think this was fixed for vertical inverted scrolling, but the fix had references to Y values specifically, so I suspect it only fixed the vertical part?

@AZIMAT
Copy link

AZIMAT commented Jan 22, 2019

I am having the same problem, react native 0.57.8 , react 16.6.3

+1

@tamirrab
Copy link
Author

Also on react-native 0.58.0

@AZIMAT

This comment has been minimized.

@kelset
Copy link
Contributor

kelset commented Jan 28, 2019

I'm pretty sure this is a duplicate of #23158

@tamirrab
Copy link
Author

tamirrab commented Jan 28, 2019

Not sure
There is a different because this issue is horizontal and the other issue is vertical

@AZIMAT
Copy link

AZIMAT commented Jan 29, 2019

I'm pretty sure this is a duplicate of #23158

Nope That was vertical
Its horizontal issue
i think vertical issue is solved

@kelset
Copy link
Contributor

kelset commented Jan 29, 2019

Does it still happen on 0.58.3?

@tamirrab
Copy link
Author

tamirrab commented Jan 29, 2019

Still not fixed on 0.58.3 :(

@AZIMAT
Copy link

AZIMAT commented Jan 29, 2019

Does it still happen on 0.58.3?

Yeap
👎

@kelset
Copy link
Contributor

kelset commented Jan 29, 2019

Ok then can any of you provide a minimal repro?

@tamirrab
Copy link
Author

tamirrab commented Jan 29, 2019

like this?

import React from "react";
import {View, FlatList, Text} from "react-native";

const setArray = () => {
    const arrayOfNumbers = [];

    for (let i = 0; i < 100; i++) {
        arrayOfNumbers.push("" + i);
    }

    return arrayOfNumbers;
};

const Demo = () => {
    return <FlatList
        inverted
        horizontal
        showsHorizontalScrollIndicator={false}
        data={setArray()}
        keyExtractor={item => item}
        renderItem={({item, index}) => {
            return <View style={{
                width: 40,
                height: 40,
                borderWidth: 1,
                justifyContent: 'center',
                alignItems: 'center',
                margin: 10
            }}>
                <Text>{item}</Text>
            </View>
        }}
    />
};

export {Demo}

matt-oakes pushed a commit to matt-oakes/react-native that referenced this issue Feb 7, 2019
Summary:
ScrollView (as well as FlatList) used with horizontal={true} and inverted={true} do not scroll as expected due to a known Android P bug.

Fixes facebook#22710. This is pretty much a clone of PR facebook#21117, applied to a horizontal ScrollView.

[Android] [Fixed] - Fix Inverted Horizontal ScrollView on Android

1. Create a test application with a FlatList with horizontal={true} inverted={true}.
2. Fill it with data
3. Scroll and release your finger
Pull Request resolved: facebook#23233

Differential Revision: D13915911

Pulled By: cpojer

fbshipit-source-id: d32c82e6d9076f5ffdf342fcd71bd921e9c8a97b
grabbou pushed a commit that referenced this issue Feb 28, 2019
Summary:
ScrollView (as well as FlatList) used with horizontal={true} and inverted={true} do not scroll as expected due to a known Android P bug.

Fixes #22710. This is pretty much a clone of PR #21117, applied to a horizontal ScrollView.

[Android] [Fixed] - Fix Inverted Horizontal ScrollView on Android

1. Create a test application with a FlatList with horizontal={true} inverted={true}.
2. Fill it with data
3. Scroll and release your finger
Pull Request resolved: #23233

Differential Revision: D13915911

Pulled By: cpojer

fbshipit-source-id: d32c82e6d9076f5ffdf342fcd71bd921e9c8a97b
t-nanava pushed a commit to microsoft/react-native-macos that referenced this issue Jun 17, 2019
Summary:
ScrollView (as well as FlatList) used with horizontal={true} and inverted={true} do not scroll as expected due to a known Android P bug.

Fixes facebook#22710. This is pretty much a clone of PR facebook#21117, applied to a horizontal ScrollView.

[Android] [Fixed] - Fix Inverted Horizontal ScrollView on Android

1. Create a test application with a FlatList with horizontal={true} inverted={true}.
2. Fill it with data
3. Scroll and release your finger
Pull Request resolved: facebook#23233

Differential Revision: D13915911

Pulled By: cpojer

fbshipit-source-id: d32c82e6d9076f5ffdf342fcd71bd921e9c8a97b
@facebook facebook locked as resolved and limited conversation to collaborators Feb 1, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: FlatList Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants