react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Multiple Modal components

Open maxs15 opened this issue 11 years ago • 17 comments

It is currently impossible to create multiple Modal components. Here is the warning that appears: Warning: Attempt to present <RCTModalHostViewController: 0x7f89e4f8c2a0> on <UIViewController: 0x7f89e4903770> which is already presenting <RCTModalHostViewController: 0x7f89e4f84f10>

I don't know if it is something you did on purpose but I think it would be a huge plus to be able to render multiple modals.

maxs15 avatar Oct 15 '15 14:10 maxs15

This is currently not possible, I'm working on supporting this. For now you should be able to nest components to achieve this behaviour.

javache avatar Oct 15 '15 15:10 javache

Ok great, thanks @javache !

maxs15 avatar Oct 15 '15 16:10 maxs15

Is this done in 0.19. I am running into the same issue and trying to put a safari view controller on a RCTModalHostViewController. This is not possible so far :(

pvenkatakrishnan avatar Feb 24 '16 00:02 pvenkatakrishnan

+1

Does anyone have a workaround for this?

ianakiara avatar Apr 08 '16 14:04 ianakiara

+1

mschipperheyn avatar Apr 08 '16 15:04 mschipperheyn

How does this nesting work?

mschipperheyn avatar Apr 08 '16 15:04 mschipperheyn

+1

dbuarque avatar Apr 13 '16 13:04 dbuarque

+1

mstuart avatar Apr 20 '16 08:04 mstuart

+1 Any progress on this?

SteveMellross avatar Jul 16 '16 08:07 SteveMellross

You should be able to present them as

<Modal>
  <Text>A</Text>
  <Modal>
    <Text>B</Text>
  </Modal>
</Modal>

javache avatar Jul 18 '16 09:07 javache

@javache so in the scenario you mention here, you would simply setState for visible on both at the same time if you wanted the nested <Modal></Modal>?

Update: I tested this, and it works perfectly. Thanks!

fostertime avatar Jul 18 '16 16:07 fostertime

how will this work if i wanted to present a SFVC on top of of a modal or vice versa ?

pvenkatakrishnan avatar Jul 18 '16 16:07 pvenkatakrishnan

Any progress on this?

wootwoot1234 avatar Aug 17 '16 18:08 wootwoot1234

@facebook-github-bot label Icebox

charpeni avatar Nov 14 '16 01:11 charpeni

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/multiple-modal-components

ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix. We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

charpeni avatar Nov 14 '16 01:11 charpeni

@facebook-github-bot close

charpeni avatar Nov 14 '16 01:11 charpeni

@charpeni tells me to close this issue. If you think it should still be opened let us know why.

facebook-github-bot avatar Nov 14 '16 01:11 facebook-github-bot