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

Alert bugg when using Modal #11084

Closed
hedegren opened this issue Nov 23, 2016 · 4 comments
Closed

Alert bugg when using Modal #11084

hedegren opened this issue Nov 23, 2016 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@hedegren
Copy link

Description

When having a view (Modal) on screen, and then display and Alert.alert(), things gets buggy. Alert will get dismissed, and the modal will stay on screen even after a reload, must restart the app in order to remove it.

Reproduction

componentDidMount() {
    setTimeout(() => {
	Alert.alert("alert"); // Alert will be dismissed right after displayed
        this.setState({ loading: false })
     }, 1000);
}

render() {
    return (
	<View>
            <Modal visible={this.state.loading}>
		<Text>Loading</Text>
	    </Modal>
        </View>
    )
}

Additional Information

  • React Native version: 0.37.0
@hedegren hedegren changed the title Alert error when using Modal Alert bugg when using Modal Nov 23, 2016
@baurine
Copy link

baurine commented Nov 23, 2016

yes, Alert and Modal have confliction in iOS seems after react-native 0.33, already has some discuss in #10471 .

my workaround way:

Alert.alert("title", "msg", [
  { text: "ok", onPress: () => { this.setState{loading: false} }
])

@mkonicek
Copy link
Contributor

Can you reproduce this on rnplay.org? Please provide a link.

@nihgwu
Copy link
Contributor

nihgwu commented Nov 25, 2016

@mkonicek I've provided a full demo in #10471 , I've pinged someone but no response still.

@mkonicek
Copy link
Contributor

Closing as #10471 has more info.

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants