@samitouri / QOS-React-2 / commits / 9c961c0a27

Fix some iframe edge cases (#13650)

Should fix #13648 by fallback on `window` when `document.defaultView` does not exists anymore

Jérôme Steunou committed Sep 14, 2018 at 17:44 UTC 9c961c0a279e31015b8df987bd86e6fec7548614
1 file changed +1 -1
packages/react-dom/src/client/ReactDOMSelection.js
+1 -1
@@ -152,7 +152,7 @@ export function getModernOffsetsFromPoints(
152 */
153 export function setOffsets(node, offsets) {
154 const doc = node.ownerDocument || document;
155 - const win = doc ? doc.defaultView : window;
155 + const win = (doc && doc.defaultView) || window;
156 const selection = win.getSelection();
157 const length = node.textContent.length;
158 let start = Math.min(offsets.start, length);