简体   繁体   English

如何在不关闭父模态的情况下在模态中打开模态 | 反应模式

[英]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.我正在使用React Modal Plugin来显示模态。 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.但是第一个打开的modal,应该留在后面。 I didn't see any documentation regarding this.我没有看到任何关于此的文档。

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.当您单击第二个模态的开始元素时,它会出现在第一个的前面,而第一个在后台保持打开状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM