Skip to content

Bug: "Unspecified error" some of the time in IE11 in iframe #19530

Closed
@mparizeau-pdftron

Description

@mparizeau-pdftron

React version: 16.12

Steps To Reproduce

  1. Open http://cygnetuat.sterlingdatarooms.com/PDFTronClientTest/ in IE11
  2. 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

image

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

node.ownerDocument.activeElement !== node

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions