Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

遮罩层级问题 #3

Open
raotaohub opened this issue Aug 16, 2024 · 0 comments
Open

遮罩层级问题 #3

raotaohub opened this issue Aug 16, 2024 · 0 comments

Comments

@raotaohub
Copy link
Owner

raotaohub commented Aug 16, 2024

使用antd弹窗ez-modal-react打开一个弹窗,接着使用非 ez-modal-react 方式再打开一个弹窗,接着关闭这2个弹窗再次打开。

重复2次以上这个步骤。

这时ez-modal-react打开的弹窗,会被第二个弹窗的遮罩挡住。

原因在于非ez-modal-react 打开的弹窗没有在关闭后销毁,他的dom占位还在html中,因为antd是根据弹窗占位的元素创建的先后顺序来安排z-index的。

需要配合非ez-modal-react 管理的弹窗一起使用时,解决办法如下。

  1. 给这个弹窗设置 destroyOnClose={true} 即关闭后注销(由Antd内部控制的行为)
  2. 都用ez-modal-react来管理弹窗
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant