displayPrint on dashboardLayout Menu and AppBar
Summary
Elements of the DashboardLayout should not printed when the page is printed
I have tried to use the displayPrint, but it is ignored.
<DashboardLayout sx={{ displayPrint: 'none' }}>
<Box sx={{m:1, displayPrint: 'block'}}>
{children}
</Box>
</DashboardLayout>
I have also tried to use a customClass, but in this case the space occupied by the dashboard menu and appbar turns to blank but occupies the space
@media print {
.print {
visibility: visible;
}
.notprint {
visibility: hidden;
}
}
Examples
No response
Motivation
No response
Search keywords: displayPrint, DashboardLayout
I believe hiding the navigation in print should be the default behaviour. Let's do that for 0.9.0. We can then wait for use-cases to show it.
Fix incoming in https://github.com/mui/toolpad/pull/4334, but we've also already added an sx prop to DashboardLayout that might make it possible to do this manually.
Great! This was quick! Using sx does not work because it applies to the itself and the children, including the page content
Thanks.
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
[!NOTE] @ebengtso How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.