当模态可见时,Material UI 的模态背景不会变暗
我正在尝试找出一些非常奇怪的东西。默认情况下,Material UI 模式的背景在可见时会自行变暗。在尝试将模态居中时,我应用了 css 翻译样式 - transform: 'translate(-50%, -50%)'
,。然而,在应用这种风格后,我注意到,在应用这种风格后,调光效果消失了。此外,当我单击模式外部时,模式不再关闭。有谁知道会发生什么?请参阅CSS规则。谢谢!
modal: {
top: '50%',
left: '50%',
right: 'auto',
bottom: 'auto',
transform: 'translate(-50%, -50%)',
padding: 0,
border: 'none',
width: '60%'
},
I am trying to figure something out which is really weird. By default, the background of Material UI's modal dims itself whenever it is visible. While trying to center the modal, I am applying a css translate style - transform: 'translate(-50%, -50%)'
,. I noticed after applying this style however, after applying this one style, the dimming effect is gone. In addition, when I click outside of the modal, the modal no longer closes. Does anyone know what could be going on? Please see the css rule. Thanks!
modal: {
top: '50%',
left: '50%',
right: 'auto',
bottom: 'auto',
transform: 'translate(-50%, -50%)',
padding: 0,
border: 'none',
width: '60%'
},
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论