user4217999
user4217999

Reputation:

How to open a modal with in a modal without closing parent modal | react-modal

I am using React Modal Plugin to display the modals. I am trying to achieve to below scenario.

  1. On button click a modal will open, inside the modal, i have another button, on click of this button, need to open another modal. but the first opened modal, should stay in the back. I didn't see any documentation regarding this.

Upvotes: 0

Views: 5114

Answers (1)

Jayce444
Jayce444

Reputation: 9063

That is already supported. Just nest the modal components. That is, inside the rendered content of the first modal, render another modal component. When you click the opening element of the second modal, it will appear in front of the first, while the first stays open in the background.

Upvotes: 1

Related Questions