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

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

Closed
JSteunou opened this issue Sep 14, 2018 · 2 comments · Fixed by #13650
Closed

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

JSteunou opened this issue Sep 14, 2018 · 2 comments · Fixed by #13650

Comments

@JSteunou
Copy link
Contributor

JSteunou commented Sep 14, 2018

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?

@gaearon
Copy link
Collaborator

gaearon commented Sep 14, 2018

Probably a mistake. Send a PR please?

JSteunou added a commit to JSteunou/react that referenced this issue Sep 14, 2018
Should fix facebook#13648 by being as protective in `setOffsets` than in `getOffsets`
JSteunou added a commit to JSteunou/react that referenced this issue Sep 14, 2018
Should fix facebook#13648 by being as protective in `setOffsets` than in `getOffsets`
@JSteunou
Copy link
Contributor Author

Yep, done

JSteunou pushed a commit to JSteunou/react that referenced this issue Sep 14, 2018
Should fix facebook#13648 by fallback on `window` when `document.defaultView` does not exists anymore
gaearon pushed a commit that referenced this issue Sep 14, 2018
Should fix #13648 by fallback on `window` when `document.defaultView` does not exists anymore
Simek pushed a commit to Simek/react that referenced this issue Oct 25, 2018
Should fix facebook#13648 by fallback on `window` when `document.defaultView` does not exists anymore
jetoneza pushed a commit to jetoneza/react that referenced this issue Jan 23, 2019
Should fix facebook#13648 by fallback on `window` when `document.defaultView` does not exists anymore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants