-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Labels
BugPlatform: iOSiOS applications.iOS applications.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
When show Alert while closing Modal, the Alert dialog will disappear and the Modal will block the UI entirely even after reload, only on iOS.
'use strict';
import React, { Component } from 'react';
import {
StyleSheet,
View,
Text,
Modal,
Alert,
} from 'react-native';
class demo extends Component {
state = {
showModal: false,
}
onShowModal = () => {
this.setState({ showModal: true });
}
onCloseModal1 = () => {
this.setState({ showModal: false }, () => {
Alert.alert('Alert', 'UI will be blocked by the modal');
});
}
onCloseModal2 = () => {
this.setState({ showModal: false }, () => {
setTimeout(() => {
Alert.alert('Alert', 'Alert won\'t show');
}, 200);
});
}
onCloseModal3 = () => {
this.setState({ showModal: false }, () => {
setTimeout(() => {
Alert.alert('Alert', 'Works fine');
}, 510);
});
}
render() {
const { showModal } = this.state;
return (
<View style={styles.container}>
<Text onPress={this.onShowModal}>Show modal</Text>
<Modal animationType='slide' visible={showModal} onRequestClose={this.onCloseModal3} >
<View style={styles.container}>
<Text onPress={this.onCloseModal1}>Close modal immediately</Text>
<Text onPress={this.onCloseModal2}>Close modal after 200ms</Text>
<Text onPress={this.onCloseModal3}>Close modal after more then 500ms</Text>
</View>
</Modal>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'space-around',
},
});
export default demo;scarlac, joegoodall1, sibelius, damir-sirola, bkovacic and 231 morelocliem08, cpunion, locxm93, aligfl, slorber and 7 morelocliem08, sunny635533, cpunion, locxm93, aligfl and 7 morelocliem08, sunny635533, cpunion, locxm93, aligfl and 4 more
Metadata
Metadata
Assignees
Labels
BugPlatform: iOSiOS applications.iOS applications.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.