Comments (19)
@MatthewHerbst @aviklai wow, you guys work fast! Thank you so much for looking into this so quickly. I'll be able to update and re-test on Monday morning and I'll report back!
from react-to-print.
Yes very good finding. I thought i was doing something wrong. good examples.
from react-to-print.
Super awesome, it should support checbox checked print
from react-to-print.
I also see this issue. Not sure why. It is confusing when you fill up a form and print it, but the checkboxes you checked are unchecked.
from react-to-print.
This is a very strange bug. Does anyone know of any other circumstances where similar behavior is seen? I'm trying to narrow down where I should be looking to solve this. Thanks for the reports!
from react-to-print.
Any news on the this? Experiencing the same issue - only display checkboxes that have defaultValues
from react-to-print.
@valeriozhang I've not been able to make any progress on this. My guess is it's something arcane. Do you have any ideas?
from react-to-print.
Hi Team,
iam also facing checkbox issue the moment i click on print,All my checked are removed.
Can someone please help in this
from react-to-print.
@MatthewHerbst No sorry - haven't looked through the source. I just used CSS to modify my browser prints.
from react-to-print.
@valeriozhang what CSS did you add?
from react-to-print.
I didnt use the package.
@media print {
body * {
visibility: hidden;
}
#section-to-print, #section-to-print * {
visibility: visible;
}
#section-to-print {
/* position: absolute;
left: 0;
top: 0;
bottom: 200 */
}
}
from react-to-print.
In my current project, I'm using the pro.ant.design scaffolder and I found the same problem with the radio and check buttons, they are not well printed. Recently, I opened another issue in the ant-design repo ant-design/ant-design#15980 and this is their response about that:
Seems it's bug of browser. We can do nothing about this. Close this as won't fix.
Please feel free if you have any idea to fix this
from react-to-print.
Hi,
This works as it should but the react and react-dom versions have to be both 16.5 or above.
Looks like it was caused by a bug in react:
facebook/react#13114
Here is a working example:
https://codesandbox.io/s/6xlqn5m7nr
@MatthewHerbst FYI
from react-to-print.
Thanks @aviklai for finding that! I have been scratching my head on this one for months
from react-to-print.
@MatthewHerbst @aviklai unfortunately this isn't completely resolved. I still have this issue on React & ReactDOM 16.14.
I opened up @aviklai's CodePen example above and edited it to have the checked
value controlled by React state, as is the case for most React-driven forms in most applications, and then you can see the issue again where checked checkboxes are appearing unchecked in the print window.
from react-to-print.
@charles4221 Hi, can you share the edited codesandbox?
I created an example where the checkbox is controlled by the state and it looks o.k.
https://codesandbox.io/s/react-to-print-forked-7smdp
from react-to-print.
I am able to replicate. @aviklai in your example above, add an onClick
to the checkbox to toggle the state. Toggle it to unchecked. Then try and print, and the print preview window still shows it as checked. Very strange
from react-to-print.
@MatthewHerbst - I think the above PR should fix the issue.
from react-to-print.
Published as v2.10.2
, thanks ๐
from react-to-print.
Related Issues (20)
- codesandbox examples are not loading HOT 2
- onAfterPrint is called before print iframe appears HOT 1
- On mobile devices are not truncated accordingly ref HOT 1
- Add Border to every Page HOT 4
- Add dynamic colors to print function HOT 1
- How to check that the user click on Save in `onAfterPrint`? HOT 2
- getting Supplied Data is not a valid base64-String jsPDF.convertStringToImageData erorr while directly downloading image HOT 1
- Border top and bottom HOT 1
- Save as PDF hangs in print view HOT 1
- Blank PDF when trying to generate in production. HOT 2
- How should i handle large data to print? HOT 8
- Why does it render different content when in im browsing in mobile HOT 3
- Blank Page while printing after a certain period of time HOT 9
- How to add style using PageStyle prop, without it overriding componentโs style HOT 5
- Warning: findDOMNode is deprecated outside StrictMode. HOT 10
- Unhandled error when trying to print not fully loaded canvas elements HOT 3
- HTML doctype declaration is displaying on top of the print dialog window HOT 10
- Print datatables HOT 4
- CSS "break-before" (replacing "page-break-before") not supported HOT 3
- '.brf' file : Change the save directory. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-to-print.