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
Issue with using FlatList in Modal - Layout issue #148
Comments
|
me too |
|
Could you share a simple repo with the issue? |
|
So?How can I solve it? |
|
+1 |
5 similar comments
|
+1 |
|
+1 |
|
+1 |
|
+1 |
|
+1 |
|
Can confirm I'm experiencing this right now as well, with Expo 38. Inside the Modal I can set a View with Making a note here in case anyone finds a solution. Edit: nvm...the solution to my specific issue was surprisingly simple: set import RNModal from 'react-native-modal';
...
<RNModal isVisible={this.state.showModal}>
<View style={styles.modal}>
<FlatList style={{flex: 1}} ... />
</View>
</RNModal>and modal: {
flex: 1,
backgroundColor: 'white',
opacity: 1,
padding: 20,
borderRadius: 10,
}, |
|
@sometimescasey You saved my day at 2AM. Thank you. |
Normally, the height of FlatList can be controlled by wrapping it with the react native
However, it doesn't appear to work here.
The FlatList disregards the boundaries set by and the rows continue on.
Interestingly, if I make the FlatList horizontal, it works just fine.
Any ideas? Thank you
Below is the code for the Modal component.
<
Modal isVisible={visible}
animationIn='slideInUp'
backdropOpacity={0.5}
style={{ margin: 15 }}>
<
View style={{ height: 300 }}>
<
FlatList
data={data}
renderItem={modalBenefitItem}
keyExtractor={(item) => item.key}
scrollEnabled/>
<
/View>
<
/Modal>
The text was updated successfully, but these errors were encountered: