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

Implement workaround for print iframe removal on focus event #764

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sensasi-delight
Copy link

This pull request introduces an important update to the startPrint function in the src/utils/startPrint.ts file. The update implements a workaround to address the issue where the print iframe is removed immediately after the print dialog closes. This fixes the problem described in issue #187, where the iframe was being removed too early—before the print dialog appeared—causing the print preview to display the entire UI instead of the intended content.

  • src/utils/startPrint.ts: Added a focus event listener to remove the print iframe after the print dialog closes, addressing the lack of a reliable afterprint event in most browsers.

@MatthewHerbst
Copy link
Owner

Hey @sensasi-delight, thanks so much for this! I've been trying to think of situations where this might not work, or if it might cause problems for anything. Going to think about it for a few more days and then will merge if nothing comes up. Really appreciate you looking into this!

@sensasi-delight
Copy link
Author

Thank you for the response! Please let me know if there's anything I can clarify or improve further. I'm happy to help.

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

Successfully merging this pull request may close these issues.

2 participants