material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Divider] not printing with Firefox

Open laichak opened this issue 3 years ago • 5 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Current behavior 😯

While printing with Firefox, Divider is not showing. It works with Chrome. I am using react-to-print package for printing.

Follow up: Here is the code that produces the issue.

<Box sx={{ display: 'none', displayPrint: 'block' }}> <Divider / > < /Box>

Expected behavior 🤔

No response

Steps to reproduce 🕹

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

laichak avatar Jul 26 '22 17:07 laichak

I wasn't able to reproduce the issue. The https://mui.com/material-ui/react-divider printed (to PDF) just fine on both Edge and Firefox. Note that the Divider in its simplest form is just an <hr />. Try checking if plain hr tag prints fine on your setup.

michaldudak avatar Jul 27 '22 12:07 michaldudak

Follow up: Here is the code that produces the issue.

<Box sx={{ display: 'none', displayPrint: 'block' }}> <Divider / > < /Box>

laichak avatar Jul 27 '22 16:07 laichak

displayPrint doesn't seem to be an actual css property.

What you want is

@media print {
    display: block;
}

MonstraG avatar Jul 29 '22 15:07 MonstraG

@MonstraG it's not a CSS property. It's available in the sx prop: https://mui.com/system/display/#display-in-print

@laichak I'm still not able to reproduce your issue. I've tried both on Windows and Mac using a real printer and a PDF one. The divider shows up. It may be related to your setup.

michaldudak avatar Aug 09 '22 07:08 michaldudak

Yeah, it is weird. My workaround is explicitly set the height to 1px.

const Divider = () => ( <div style={{ height: '1px', borderTop: '1px solid #C5CAE9' }} /> );

laichak avatar Aug 09 '22 14:08 laichak

I'm going to close this since it's not reproducible on our side and we haven't seen any other reports from the community about this issue.

michaldudak avatar Oct 11 '22 19:10 michaldudak