Skip to content

Commit

Permalink
Fix some iframe edge cases (#13650)
Browse files Browse the repository at this point in the history
Should fix #13648 by fallback on `window` when `document.defaultView` does not exists anymore
  • Loading branch information
JSteunou authored and gaearon committed Sep 14, 2018
1 parent 8bc0bca commit 9c961c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function getModernOffsetsFromPoints(
*/
export function setOffsets(node, offsets) {
const doc = node.ownerDocument || document;
const win = doc ? doc.defaultView : window;
const win = (doc && doc.defaultView) || window;
const selection = win.getSelection();
const length = node.textContent.length;
let start = Math.min(offsets.start, length);
Expand Down

0 comments on commit 9c961c0

Please sign in to comment.