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

Modal没有完全遮挡其他元素 #2762

Closed
joesonw opened this issue Aug 18, 2016 · 10 comments
Closed

Modal没有完全遮挡其他元素 #2762

joesonw opened this issue Aug 18, 2016 · 10 comments

Comments

@joesonw
Copy link
Contributor

joesonw commented Aug 18, 2016

本地环境

  • antd 版本: 1.9.1
  • 操作系统及其版本:osx
  • 浏览器及其版本: nodejs6 + chrome

你做了什么?

外层有一个Menu在左边, 右边是内容
右边子组件里使用了Modal

你期待的结果是:

正常遮挡住所有元素

实际上的结果:

左边Menu没被遮挡住

image

@benjycui
Copy link
Contributor

左侧 Menu 或者他的祖先元素的 z-index 比 Modal 的高了,调整下就好。

@joesonw
Copy link
Contributor Author

joesonw commented Aug 18, 2016

@benjycui 都是默认的组件, 没有设置z-index, 而且modal设置了z-index 999 也没有用..

@benjycui
Copy link
Contributor

左侧 Menu 或者他的祖先元素的 z-index 比 Modal 的高了

建议认真学习堆栈上下文的概念。

@afc163
Copy link
Member

afc163 commented Aug 18, 2016

给个重现。

http://codepen.io/anon/pen/wGOWGW?editors=001

afc163 added a commit that referenced this issue Aug 20, 2016
maybe it can close #2762 😄
@afc163
Copy link
Member

afc163 commented Aug 20, 2016

只能尝试修复了。。。

@afc163 afc163 closed this as completed Aug 20, 2016
@benjycui
Copy link
Contributor

其实我觉得是外层容器的原因 https://www.qianduan.net/that-thing-on-the-z-index/

@joesonw 你应该是修改了 Modal 的容器节点吧。

@joesonw
Copy link
Contributor Author

joesonw commented Aug 22, 2016

新的z-index: auto好像也是有问题的哦. http://codepen.io/anon/pen/OXYrQA?editors=001

@afc163
Copy link
Member

afc163 commented Aug 22, 2016

你不给重现,无法定位,只能盲改。

@benjycui
Copy link
Contributor

@joesonw 你应该是修改了 Modal 的容器节点吧。

@lock
Copy link

lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants