mui-toolpad icon indicating copy to clipboard operation
mui-toolpad copied to clipboard

displayPrint on dashboardLayout Menu and AppBar

Open ebengtso opened this issue 1 year ago • 1 comments

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

ebengtso avatar Oct 05 '24 09:10 ebengtso

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.

Janpot avatar Oct 07 '24 09:10 Janpot

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.

apedroferreira avatar Oct 29 '24 18:10 apedroferreira

Great! This was quick! Using sx does not work because it applies to the itself and the children, including the page content

Thanks.

ebengtso avatar Oct 29 '24 20:10 ebengtso

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.

github-actions[bot] avatar Oct 29 '24 20:10 github-actions[bot]