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 1ab3dca commit 2ada60dCopy full SHA for 2ada60d
src/component/selection/setDraftEditorSelection.js
@@ -304,9 +304,11 @@ function addFocusToSelection(
304
// Additionally, clone the selection range. IE11 throws an
305
// InvalidStateError when attempting to access selection properties
306
// after the range is detached.
307
- var range = selection.getRangeAt(0);
308
- range.setEnd(node, offset);
309
- selection.addRange(range.cloneRange());
+ if (selection.rangeCount > 0) {
+ var range = selection.getRangeAt(0);
+ range.setEnd(node, offset);
310
+ selection.addRange(range.cloneRange());
311
+ }
312
}
313
314
0 commit comments