react-easy-print
react-easy-print copied to clipboard
Get different results from window.print() and ctrl+p
I am getting different results from ctrl + p and window.print() in chrome 59
Hey, @bofa
Show me more info please (a screenshot and code sample will be cool)
@bofa I had the same problem, you just have to wrap the things you're not printing with <NoPrint> </NoPrint>
Yep, it was designed as so to cover multiple use-cases
I'll add example with <NoPring>
in top level
https://github.com/a-x-/react-easy-print/commit/019c54347063ddb0ba2cd5b67939706ff85b6612
@bofa Has this solved your problem?
I could confirm the issue (tested on Chrome), and that the workaround works.
When using Ctrl + P, with <Print exclusive>
, it works like a charm, but it doesn't work with window.print()
.
Refactoring the code to use Print
and NoPrint
as @Bamii commented, instead of the exclusive
usage, it works fine both ways.
I've added <NoPrint> on top level still Ctrl+p and window.print have different view
Work around : add @media print and give styling to you app using position:relative and bottom property not a good solution but it serving its purpose for now
this still bug anyway
<PrintProvider> <NoPrint> ...code </NoPrint> <Print> ..code </Print> </PrintProvider>