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 滚动时背景还是会滚动 #1751

Closed
yesmeck opened this issue May 18, 2016 · 4 comments · Fixed by react-component/dialog#29
Closed

Modal 滚动时背景还是会滚动 #1751

yesmeck opened this issue May 18, 2016 · 4 comments · Fixed by react-component/dialog#29

Comments

@yesmeck
Copy link
Member

yesmeck commented May 18, 2016

What you did

打开一个高度超过浏览器窗口大小的 Modal

What you would like to happen

滚动 Modal 时背景不应该滚动

What actually happened

滚动 Modal 时背景会滚动

Online demo

http://ant.design/#/components/modal 这里就能重现

看起来是在某个提交里把这个文件弄丢了。

@afc163 afc163 closed this as completed in a15b601 May 18, 2016
@afc163
Copy link
Member

afc163 commented May 18, 2016

呃,居然搞丢了。

@afc163
Copy link
Member

afc163 commented May 20, 2016

现在打开弹窗时,页面有会跳动。

原因是从有滚动条变成没滚动条。比如:http://ant.design/#/components/modal (在 windows 系统或开启占位滚动条的 OSX 下可见)

看了下 http://getbootstrap.com/javascript/#modals-sizes 的做法,在 body 上加了个 padding-right: 17px 来规避这个问题。我们也加上。

@afc163
Copy link
Member

afc163 commented May 20, 2016

https://github.com/twbs/bootstrap/blob/795d2208b882e194e6059a1639e056e020d64072/js/modal.js#L259-L267

而且居然是动态计算出来的滚动条占位宽度,这个细节真心好赞。

@lock
Copy link

lock bot commented May 5, 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 5, 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

Successfully merging a pull request may close this issue.

2 participants