question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

multiple modals not working

See original GitHub issue

I switched from react-native’s default Modal to react-native-modal and i noticed that if I have multiple modals open at the same time, only one will ever be visible.

react-native’s modal handles this correctly: they display only the first one, but if i dismiss, i see the other modals.

With react-native-modal, the others are simply ignored, altough they are mounted with isVisible={true}. This leads to inconsistency.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
kalwaniyashcommented, Sep 7, 2018

@jojonarte @IlifilzaRusli Hey, the approach that i used is this. There is a class ( say A ) that is build on top of the react-native-modal, every time some class ( say B ) needs a modal to be shown it calls class A. Class A puts the instance of class B into a queue. Now if another class ( say c ) needs a modal, it again calls A. A then checks if there is any other instance that is open. It sees that B is already open, it then closes the modal B deletes its instance and opens C and saves its instance. This cycle keeps on going.

Sorry for the delay, by this weekend i’ll be making the entire code public.

4reactions
452MJcommented, Jun 24, 2021

Just try embed ModalB in ModalA. It will work.

<ModalA>
   <ModalB/>
</ModalA>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap multiple model popup not working - Stack Overflow
What happens is when I click the id="myModal1" the popUp is opening but I am not able to access the buttons inside it,...
Read more >
Modal not working when have multiple modal in same page?
Hi when I have more than one modal in same page, the first button modal will keep load the second modal and not...
Read more >
Managing Multiple Bootstrap Modals - Arroyo Labs
If you've had extensive experience in bootstrap, you may find that managing multiple bootstrap modals may not be so simple. Unless your goal...
Read more >
[Resolved] Multiple modals on same page not working - Toolset
I have button in each Loop for opening modal.
Read more >
Working with Multiple Bootstrap Modals - CodePen
A simple way to work with multiple modals, while avoiding issues with the z-index. Fade can be toggled on or off to show...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found