@portabletext/editor 2.9.0 → 2.9.1
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/lib/_chunks-dts/behavior.types.action.d.ts +12 -12
- package/lib/index.cjs +6 -2
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +6 -2
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.d.ts +3 -3
- package/package.json +2 -2
- package/src/editor/Editable.tsx +12 -1
package/lib/index.js
CHANGED
|
@@ -2284,8 +2284,12 @@ PortableTextEditable.displayName = "ForwardRef(PortableTextEditable)";
|
|
|
2284
2284
|
function validateSelection(slateEditor, activeElement) {
|
|
2285
2285
|
if (!slateEditor.selection)
|
|
2286
2286
|
return;
|
|
2287
|
-
|
|
2288
|
-
|
|
2287
|
+
let root;
|
|
2288
|
+
try {
|
|
2289
|
+
root = ReactEditor.findDocumentOrShadowRoot(slateEditor);
|
|
2290
|
+
} catch {
|
|
2291
|
+
}
|
|
2292
|
+
if (!root || activeElement !== root.activeElement)
|
|
2289
2293
|
return;
|
|
2290
2294
|
const domSelection = ReactEditor.getWindow(slateEditor).getSelection();
|
|
2291
2295
|
if (!domSelection || domSelection.rangeCount === 0)
|