Skip to content

遮罩层级问题 #3

@raotaohub

Description

@raotaohub

使用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来管理弹窗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions