multiple modals not working
See original GitHub issueI 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:
- Created 5 years ago
- Reactions:7
- Comments:22 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
Just try embed ModalB in ModalA. It will work.