-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selecting printer on Safari + Chrome on iOS removes print preview, prints blank page #193
Comments
Update: looks like increasing the timeout for removing the iFrame is a fix.
|
Increasing the timeout is the masking the real problem here. After digging in some more I've noticed a difference between desktop and mobile behavior. On desktop, when you open the print dialog the iFrame remains in the DOM indefinitely. You can click around the modal, select your printer, etc. On mobile, opening the print dialog the iFrame is removed as soon as its timeout is reached. Once that happens, if you select a different printer the preview will disappear, even if you do nothing and just wait out the timeout you'll still get a blank page upon printing. So it seems like the browser's print dialog pauses the printing process on desktop, but not on mobile. |
Thanks for digging in @evanb2 , this explains a lot and is likely similar/same to #152 This has implications across the board and will require more digging and potential rework (removing timeouts and going full event based, which is challenging due to the differences in events across browsers and OSs |
One option is to not remove the print iframe at all. This goes against the best practice of not removing things added to the DOM when done, but it may solve the issue. I could always add a check for any iframes with a specific class and remove them prior to the construction of the new print iframe. @oculus42 what do you think? |
Relying on timeouts doesn't work on mobile. Implements fix suggested here: jasonday#193 (comment)
Describe the bug
Print Preview disappears (and prints a blank page) after selecting a printer on Chrome and Safari iOS.
To Reproduce
On Safari iOS:
Expected behavior
Print preview will persist after selecting a printer.
Smartphone (please complete the following information):
Additional context
The same bug occurs on iOS Chrome after applying the fix mentioned here
Setting
debug: true
fixes the problem.The text was updated successfully, but these errors were encountered: