Description
React version: 16.12
Steps To Reproduce
- Open http://cygnetuat.sterlingdatarooms.com/PDFTronClientTest/ in IE11
- Wait for the application to load in the iframe
The current behavior
Sometimes an "Unspecified error" will appear in the console and the viewer in the iframe won't load
Unfortunately it is not 100% reproducible. Sometimes the error won't occur. I'm also having trouble creating a minimal sample to reproduce this.
The expected behavior
There is no error.
Investigation
The relevant line in the callstack where the error is occurring is here
I suspect it might be the same issue discussed here Availity/react-block-ui#18
This was a real pain to track down, but apparently IE 11 will just throw Unspecified error. when accessing document.activeElement from an <iframe>, sometimes.
The solution they used to fix the error was to use this function instead of accessing document.activeElement directly https://gist.github.com/Alex1990/046a6553dc83e22dd6f4
Ideally this function could be used inside React as well. I am also happy to use a workaround if there is one.