admin管理员组文章数量:1334133
Currently, I am using the fullScreen property on the Material UI Dialog ponent (which acts as a modal on the screen) as remended in the docs, like this:
import useMediaQuery from '@material-ui/core/useMediaQuery';
function MyComponent() {
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));
return <Dialog fullScreen={fullScreen} />
}
Unfortunately, this causes the Dialog modal to cover the navbar at the top of the screen. I would like to override the height of the Dialog modal, but I am not sure how.
Is anyone able to help?
Currently, I am using the fullScreen property on the Material UI Dialog ponent (which acts as a modal on the screen) as remended in the docs, like this:
import useMediaQuery from '@material-ui/core/useMediaQuery';
function MyComponent() {
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));
return <Dialog fullScreen={fullScreen} />
}
Unfortunately, this causes the Dialog modal to cover the navbar at the top of the screen. I would like to override the height of the Dialog modal, but I am not sure how.
Is anyone able to help?
Share Improve this question asked Sep 10, 2021 at 1:34 Jack JosephJack Joseph 1292 silver badges7 bronze badges1 Answer
Reset to default 6Just pass a className to it & give it the top value equal to your AppBar's height. here is the sandbox
本文标签: javascriptCustom 39full screen39 height for the Material UI Dialog modal componentStack Overflow
版权声明:本文标题:javascript - Custom 'full screen' height for the Material UI Dialog modal component - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742357052a2459622.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论