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

[DevMenu] (AlertView / ActionSheet) is not activated when a view controller is presented modally #2063

Closed
fatuhoku opened this issue Jul 20, 2015 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@fatuhoku
Copy link

Reproduction:

  1. Present a simple UIViewController with vc.modalPresentationStyle = UIModalPresentationFormSheet
  2. Shake the device.
  3. Observe that the following error is produced:
Warning: Attempt to present <UIAlertController: 0x7fba7bd348f0>  on <UIViewController: 0x7fba7bf4a1e0> which is already presenting <UIViewController: 0x7fba7bee1d90>

I've run into this issue because I put a RootView into a modally presented formsheet, and wish to test solely that.

@brentvatne brentvatne changed the title React Native dev menu (AlertView / ActionSheet) is not activated when a view controller is presented modally [DevMenu] (AlertView / ActionSheet) is not activated when a view controller is presented modally Jul 20, 2015
@brentvatne
Copy link
Collaborator

Could you submit a PR for this? It's not required functionality for Facebook at the moment, as far as I know, so a fix wouldn't be available anytime soon.

Also, while it's nice to provide a set of steps to reproduce this, a sample app would greatly reduce the friction to people helping.

@dsibiski
Copy link
Contributor

@fatuhoku I tried to reproduce the problem but I couldn't. The Dev Menu comes up no matter what. I'm using the following code to present a modal viewController with the rootView loaded as it's view:

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"TestActionSheet"
                                                   launchOptions:launchOptions];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];

UIViewController *modal = [[UIViewController alloc] init];
modal.view = rootView;
modal.modalPresentationStyle = UIModalPresentationFormSheet;

self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];

[self.window.rootViewController presentViewController:modal animated:YES completion:nil];

Also, the warning message that you are getting is strange...mainly because in React Native the DevMenu is not using the UIAlertController. It is using the deprecated UIActionSheet still: https://github.com/facebook/react-native/blob/master/React/Base/RCTDevMenu.m#L339

So I am thinking that it is something else with your setup. As @brentvatne mentioned, if you could produce a sample project that would be very helpful. :)

@browniefed
Copy link
Contributor

@brentvatne close and reopen if more information is provided.

@ide ide closed this as completed Sep 13, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 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

6 participants