最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - have antd modal height and width 100 - Stack Overflow

programmeradmin1浏览0评论

i'm trying to figure out how to have antd modal open and have height of 100% and width of 100%, tried different ways but always getting scroll y and x, and if i put height of 100vh then using different mobile devices it still can scroll down for some reason, so my question is how to get this modal perfectly 100% height and width without any scrollings, here is my code:

=/index.css

i'm trying to figure out how to have antd modal open and have height of 100% and width of 100%, tried different ways but always getting scroll y and x, and if i put height of 100vh then using different mobile devices it still can scroll down for some reason, so my question is how to get this modal perfectly 100% height and width without any scrollings, here is my code:

https://codesandbox.io/s/to-customize-the-width-of-modal-antd4154-forked-kfbzj?file=/index.css

Share Improve this question edited May 10, 2021 at 17:55 asked May 10, 2021 at 16:53 user10727653user10727653
Add a ment  | 

2 Answers 2

Reset to default 2

Hope this help https://codesandbox.io/s/to-customize-the-width-of-modal-antd4154-forked-mxx4j?file=/index.js

For more information:

  • Change modal's width to "100vw"
  • Change modal content to 100vw x 100vh with overflow auto

Please take reference from the below solution, setting below CSS worked for me: https://codesandbox.io/s/to-customize-the-width-of-modal-antd4154-forked-r0e0k?file=/index.css

.ant-modal {
  width: 100%;
  transform-origin: 85px 43px;
  overflow: hidden;
  height: -webkit-fill-available;
}
发布评论

评论列表(0)

  1. 暂无评论