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

FlatList with 2 columns are not acting as expected #19156

Closed
SurajMDurgad opened this issue May 7, 2018 · 2 comments
Closed

FlatList with 2 columns are not acting as expected #19156

SurajMDurgad opened this issue May 7, 2018 · 2 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot.

Comments

@SurajMDurgad
Copy link

SurajMDurgad commented May 7, 2018

I'm using a FlatList with 2 columns, it works fine except in few rows, it takes the complete row.

Environment

OS: macOS High Sierra 10.13.4
Node: 9.11.1
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4697961

Packages: (wanted => installed)
react: ^16.3.0-alpha.1 => 16.3.1
react-native: ^0.54.0 => 0.54.4

Steps to Reproduce

Run the below mentioned code and pass an array of data to the FlatList.

Here is my code -

<FlatList vertical numColumns={2} extraData={this.state} data={this.state.bikeCities} style={styles.CityListView} showsVerticalScrollIndicator={false} keyExtractor={(item, index) => index.toString()} renderItem={({item:rowData, index}) => { if(rowData.country_id == this.state.selectedCountryId) { return( <TouchableOpacity style={styles.FlatListStyle} onPress={() => this.props.citySelection(rowData, this.state.selectedView)}> <Text style={styles.cityText}>{rowData.name}</Text> </TouchableOpacity> ); } }}/>

Expected Behavior

Each row should have 2 columns.

Actual Behavior

In few rows only one column is rendered.
I've rendered a screenshot.

simulator screen shot - iphone 6 - 2018-05-07 at 12 04 05

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?

Thank you for your contributions.

@react-native-bot react-native-bot added ❔Needs More Information Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Ran Commands One of our bots successfully processed a command. labels May 7, 2018
@react-native-bot
Copy link
Collaborator

This issue looks like a question that would be best asked on Stack Overflow.

Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

Will close this as this is really a question that should be asked on Stack Overflow.

@facebook facebook locked as resolved and limited conversation to collaborators May 7, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: For Stack Overflow A question for Stack Overflow. Applying this label will cause issue to be closed. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants