Skip to content
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

printDelay issue #222

Closed
mcanepa opened this issue Jun 2, 2021 · 2 comments
Closed

printDelay issue #222

mcanepa opened this issue Jun 2, 2021 · 2 comments

Comments

@mcanepa
Copy link

mcanepa commented Jun 2, 2021

I was revisiting #176. I upgraded from 1.12.3 to 1.15.1 and to my surprise, the issue I reported was still happening...

As an addendum, I can say that the problem that I'm facing is that while online (not localhost), the print preview sometimes renders correctly and sometimes it doesn't (firefox and chrome)

This time around I used the printDelay option and changed it from 333 to 1000 and et voilà, the issue is gone. So I'm guessing that something is triggering before the plugin completely loads all the css. I've read #213 and #215 and they are similar to this.

So may be instead of a timer, the code should do what it does after some kind of .ready(), .load() or .done() method

Thanks!

@mcanepa
Copy link
Author

mcanepa commented Jun 2, 2021

Using Firefox's network monitor, I see that every time the print preview fails (incorrect render) it's because some styles are loaded after the preview window is shown.

If the styles are loaded fast, then the print preview shows exactly what I expected

A small printDelay, like default 333 o 500 isn't enough and make it seems like a random bug, but with larger numbers it works everytime.

So yes, as you already know...this is a timing issue

@jasonday
Copy link
Owner

That's absolutely in the plan, the issue is that the events between browsers and platforms is inconsistent, so we have to look further into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants