Skip to content

16.5 with better support of iframe has some side effects #13648

Closed
@JSteunou

Description

@JSteunou

Do you want to request a feature or report a bug?

bug

What is the current behavior?

When transitioning from a state having an iframe inside a component to a state without that said iframe, we have an error at setOffsets(node, offsets) because node.ownerDocument.defaultView being null

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

Working on it

What is the expected behavior?

Should not break

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Affected since this 16.5.0, coming from this PR exactly https://github.com/facebook/react/pull/12037/files#diff-26d90cba6ee597ef475fa80dcf76ae1d

getOffsets as a check on ownerDocument.default fallbacks to window, but setOffsets does not.

Is there a reason why?

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