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

PrimeNG p-dialog 垂直滚动 #5

Open
ryancui92 opened this issue Jul 19, 2017 · 0 comments
Open

PrimeNG p-dialog 垂直滚动 #5

ryancui92 opened this issue Jul 19, 2017 · 0 comments

Comments

@ryancui92
Copy link
Owner

Dialog 组件当 content 过多时需要可滚动,根据文档这么写

<p-dialog appendTo="body" [modal]="true"
  [width]="700" [height]="400" [contentStyle]="{'overflow': 'auto'}">
</p-dialog>

特么这样是不行的,并没有滚动条出现,看 style 发现是 CSS 的 height 未指定导致 overflow 失效,所以要在 style 里指定 max-height. 这里设置 [height] 属性并没有在 CSS 上设置相应的 height 值。

<p-dialog appendTo="body" [modal]="true"
  [width]="700" [contentStyle]="{'max-height': '400px', 'overflow': 'auto'}">
</p-dialog>

使用 max-height 替代 height 可以使 dialog 在超出高度才 scroll

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