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

Multiple Alerts stacked on iOS instead of being replaced #14873

Closed
Thibaut-Fatus opened this issue Jul 6, 2017 · 5 comments
Closed

Multiple Alerts stacked on iOS instead of being replaced #14873

Thibaut-Fatus opened this issue Jul 6, 2017 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Thibaut-Fatus
Copy link

Thibaut-Fatus commented Jul 6, 2017

Is this a bug report?

Yes

Have you read the Bugs section of the Contributing to React Native Guide?

yes

Environment

react-native-cli: 1.0.0
react-native: 0.43.4 (simulator screenshots) and 0.45.1 (Expo demo)
node: v7.7.4
npm: 4.1.2

Then, specify:

  1. Target Platform: iOS
  2. Development Operating System macOS Sierra
  3. Build tools Xcode (8.3)

Steps to Reproduce

Displaying successive Alerts on iOS leads to an overlay (multiple Alerts displayed, you need to click them one by one to get back to the app)

Alert.alert('title', 'lorem', [
  { text: 'cancel', onPress: () => true },
  { text: 'read', onPress: () => this.doWhatever() },
]);

Expected Behavior

On Android, if an Alert is already displayed when calling Alert.alert the new Alert replace the previous one. It should be the same on iOS since there is no way to delete / cancel alert without pressing the buttons on it.

Actual Behavior

Alerts are stacked on iOS instead of being replaced when a new one is created, both on simulator and on device, even build with a release scheme.

Reproducible Demo

I've setup an Expo project here: run it on iOS to reproduce the bug.

https://github.com/weassur/RNAlertBug

and a snack:

https://snack.expo.io/rynGz03N-

there are no dependencies other than to the Alert API

@Ehesp
Copy link
Contributor

Ehesp commented Jul 10, 2017

I always thought this was expected iOS behaviour. Agreed it's annoying as you can't have the same code base to handle alerts.

@Thibaut-Fatus
Copy link
Author

This does not look like an expected behaviour

@hramos
Copy link
Contributor

hramos commented Sep 21, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Sep 21, 2017
@hramos hramos closed this as completed Sep 21, 2017
@Thibaut-Fatus
Copy link
Author

Seems like it should remain open, this is definitely a bug.

@alexandrzavalii
Copy link

Is there a way to close old Alert before showing the new one ?

@facebook facebook locked as resolved and limited conversation to collaborators Sep 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 21, 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