We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent effe670 commit e86fefeCopy full SHA for e86fefe
packages/react-dom/src/client/ReactDOMSelection.js
@@ -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;
+ 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);
0 commit comments