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能使用高度百分比 #18738
Comments
手动用样式控制下内容区域的高度: <Modal
title="20px to Top"
visible={this.state.modal1Visible}
onOk={() => this.setModal1Visible(false)}
onCancel={() => this.setModal1Visible(false)}
>
+ <div style={{ height: '60vh', overflowY: 'auto' }}>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p><p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p>
<p>some contents...</p><p>some contents...</p>
<p>some contents...</p><p>some contents...</p>
+ </div>
</Modal> |
试过
试过,但是没有用处,主要是外部modal无法设置高度,内部设置百分比没有参考依据,所以无法生效 |
Modal 的高度根据内部来的 |
你可以尝试下,内部高度使用百分比是无效的,这个时候modal的高度会自适应。问题在于当我在一个页面使用modal的时候,我并不知道用户浏览器是多高,所以如果设置modal内部内容的高度的话,会导致页面内部出现一个滚动条,modal自身也会出现滚动条,滚动鼠标滑轮的时候两者会同时滚动,体验效果不好 |
可以使用 |
希望增加一个可以设置modal整体高度百分比的属性,类似width的 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this feature solve?
modal无法设置高度百分比,导致modal高度超出页面高度
What does the proposed API look like?
height="70%"
The text was updated successfully, but these errors were encountered: