slate-react 0.98.4 → 0.99.0-2023821224757

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -560,6 +560,13 @@ var ReactEditor = {
560
560
  IS_FOCUSED.set(editor, true);
561
561
 
562
562
  if (root.activeElement !== el) {
563
+ if (editor.selection && root instanceof Document) {
564
+ var domSelection = root.getSelection();
565
+ var domRange = ReactEditor.toDOMRange(editor, editor.selection);
566
+ domSelection === null || domSelection === void 0 ? void 0 : domSelection.removeAllRanges();
567
+ domSelection === null || domSelection === void 0 ? void 0 : domSelection.addRange(domRange);
568
+ }
569
+
563
570
  el.focus({
564
571
  preventScroll: true
565
572
  });