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 124bac2 commit 31b88d9Copy full SHA for 31b88d9
packages/react-dom/src/client/ReactDOMSelection.js
@@ -153,6 +153,14 @@ export function getModernOffsetsFromPoints(
153
export function setOffsets(node, offsets) {
154
const doc = node.ownerDocument || document;
155
const win = (doc && doc.defaultView) || window;
156
+
157
+ // Edge fails with "Object expected" in some scenarios.
158
+ // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
159
+ // fails when pasting 100+ items)
160
+ if (!win.getSelection) {
161
+ return;
162
+ }
163
164
const selection = win.getSelection();
165
const length = node.textContent.length;
166
let start = Math.min(offsets.start, length);
0 commit comments