NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

[Android] ListView/FlatList not able to scroll inside Content component

Open thienlhh opened this issue 9 years ago • 10 comments

I have a FlatList inside a Content component with some other components that make the Content over height and scrollable. The problem I have that the FlatList was not able to scroll when Content scrollable.

react-native, react and native-base version

react: 16.0.0-alpha.12 react-native: 0.45.1 native-base: 2.2.0

Expected behaviour

The List should scrollable

Steps to reproduce (code snippet or screenshot)

My list: <FlatList style={{ width: '100%', borderWidth: 1, borderColor: '#e0e1e2', marginTop: 10, height: 270, flex: 1 }} data={positions} renderItem={this.renderPosition} keyExtractor={(item, index) => item.id} />

Is the bug present in both ios and android or in any one of them?

Android only

thienlhh avatar Sep 11 '17 06:09 thienlhh

same issu

sachithamh avatar Sep 12 '17 04:09 sachithamh

@thienlhh Remove the height from the FlatList. If you really need the list to be taking up only that much of space. Wrap it with a View maybe and apply the height there

shivrajkumar avatar Sep 12 '17 06:09 shivrajkumar

Thanks @shivrajkumar for tip, may be I'll try later as my project running to deadline. I have to use an other workaround by using NestedScrollView

thienlhh avatar Sep 12 '17 08:09 thienlhh

I am encountering this same issue, and I do not have a fixed height set for the FlatList, but on a View as suggested by @shivrajkumar.

jkeller22 avatar Sep 20 '17 19:09 jkeller22

@jkeller22 Were you able to resolve this as per suggestion?

shivrajkumar avatar Sep 28 '17 12:09 shivrajkumar

did anyone find any solution?

bispul avatar Nov 06 '17 16:11 bispul

@thienlhh In this case, if possible use a <View/> instead of <Content/>.

As wrapping the ListView inside the ScrollView the parent scroll action dominates the child scroll action which leads only ScrollView to scroll.

See React Native issue comment here

akhil-ga avatar Nov 09 '17 10:11 akhil-ga

Closing the issue due to no response

akhil-ga avatar Nov 20 '17 05:11 akhil-ga

Did any of suggested earlier and nothing seems to be helping. Any update? My FlatList not even nested, still it is showing no signs of life or scrollability in particular...

<View> <FlatList data={numbers} renderItem={this._renderNumbers} keyExtractor={this._keyExtractor} /> </View>

olekspickle avatar May 31 '18 14:05 olekspickle

@alexgnatrow can you try this https://github.com/facebook/react-native/issues/1966#issuecomment-285130701

akhil-ga avatar Jun 01 '18 06:06 akhil-ga