Modal: Refresh (via dev menu) does not tear down
See original GitHub issueIs this a bug report?
yes
Have you read the Contributing Guidelines?
kind of
Environment
Environment: OS: Windows 10 Node: 9.0.0 Yarn: 1.3.2 npm: 5.5.1 Watchman: Not Found Xcode: N/A Android Studio: Version 3.0.0.0 AI-171.4408382
Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.53.0 => 0.53.0
Target Platform: Android 7.0 on Samsung Galaxy S5
Steps to Reproduce
- create app and launch with
react-native run-android
- trigger state which causes a modal to show
- launch the dev menu (via shake or keycode)
- select refresh
Expected Behavior
The app closes the modal and refreshes
Actual Behavior
The app presumably refreshes, but the modal stays on top and cannot be closed
Reproducible Demo
import React, { Component } from 'react';
import { Text, View, Button, Modal, StyleSheet } from 'react-native';
export default class MyComponent extends Component {
state = {
modalVisible: false,
};
openModal() {
this.setState({modalVisible:true});
}
closeModal() {
this.setState({modalVisible:false});
}
render() {
return (
<View style={styles.container}>
<Modal
visible={this.state.modalVisible}
animationType={'slide'}
onRequestClose={() => this.closeModal()}
>
<View style={styles.modalContainer}>
<View style={styles.innerContainer}>
<Text>This is content inside of modal component</Text>
<Button
onPress={() => this.closeModal()}
title="Close modal"
>
</Button>
</View>
</View>
</Modal>
<Button
onPress={() => this.openModal()}
title="Open modal"
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
modalContainer: {
flex: 1,
justifyContent: 'center',
backgroundColor: 'grey',
},
innerContainer: {
alignItems: 'center',
},
});
Issue Analytics
- State:
- Created 6 years ago
- Reactions:117
- Comments:77 (9 by maintainers)
Top Results From Across the Web
Reload content in modal (twitter bootstrap)
You can force Modal to refresh the popup by adding this line at the end of the hide method of the Modal plugin...
Read more >How to Make a Modal Popup Refresh Items on the Page
Refreshing Page Using onClick Event This is a mandatory function required to close the modal invoked by the onHide event. Call the reload() ......
Read more >Angular 8 #16; Refresh GRID on Modal close - YouTube
If this video is helpful to you, you can support this channel to grow much more by supporting on patreon ...
Read more >Using modals in Slack apps
Modals are a focused surface to collect data from users or display dynamic and interactive information. To users, modals appear as focused surfaces...
Read more >lightning-modal - documentation
There is no lightning-modal component. Instead, you create a modal by extending LightningModal and using these helper lightning-modal-* components to provide a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirming, still an issue in RN 0.60.4
Still an issue on react-native
0.59.3