【问题标题】:Shifting content left Material UI向左移动内容 Material UI
【发布时间】:2019-01-29 22:33:22
【问题描述】:

有没有人对 Material UI 下拉选择和 Modals 向左移动内容有疑问?我试图给它 position: absolute 我也试图给 MenuItems position: absolute 但内容仍然移动。

【问题讨论】:

  • 你在使用CssBaseline吗?
  • 不,我没有,但我已经规范化了 CSS。我现在尝试添加它,但没有任何变化。
  • 我看到这样的主要情况是主窗口有一个滚动条。打开模态框(Select 用于显示选项)会导致滚动条暂时消失,这可能会导致内容略有变化,具体取决于整体布局方法。这是你的场景吗?

标签: css reactjs material-ui


【解决方案1】:

您可以在此处找到相关信息:https://github.com/mui-org/material-ui/issues/10000

那里还提到了许多相关问题。根据模态框下的主窗口元素的定位方式,有不同的修复方法。

【讨论】:

  • 谢谢 :) 我去看看。
【解决方案2】:

在我的 React 应用中,这对我有用。

<body style="overflow-y: scroll;">
    //index.html
    <!DOCTYPE html>
     <html lang="en">
       <head>
       </head>
       <body style="overflow-y: scroll;">
         <noscript>
         </noscript>
         <div id="root"></div>
         <script></script>
       </body>
     </html>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-15
    • 2017-03-18
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-03
    相关资源
    最近更新 更多