react-pdf
react-pdf copied to clipboard
PDF turns blank white after changing tabs
Before you start - checklist
- [X] I followed instructions in documentation written for my React-PDF version
- [X] I have checked if this bug is not already reported
- [X] I have checked if an issue is not listed in Known issues
- [ ] If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo
Description
Since 2 days I have encountered a bug that if a PDF is opened in a tab and I switch tabs and come back after a while, the loaded PDF turns transparent and only the form fields are visible. Rest of all the PDF content fades away. I have only reproduced this on Chrome and Edge.
I was also able to reproduce the same on another website called https://simplepdf.eu/ which is also using react-pdf under the hood.
Steps to reproduce
- Open chrome.
- Go to https://simplepdf.eu/
- When the PDF loads move to another tab and open a YT video or something. Come back after a while and the PDF would have disappeared.
Expected behavior
PDF should not fade away.
Actual behavior
PDF content fades away.
Additional information
There is no error in the console.
Environment
- Browser (if applicable): Chrome, Edge
- React-PDF version: 7.7.0
- React version: 18.2.0
- Webpack version (if applicable):
Screenshot: