slate-react 0.88.2-202301434534 → 0.88.2
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 +13 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/slate-react.js +13 -3
- package/dist/slate-react.min.js +1 -1
- package/dist/utils/dom.d.ts +1 -1
- package/dist/utils/dom.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -425,8 +425,18 @@ var normalizeDOMPoint = function normalizeDOMPoint(domPoint) {
|
|
|
425
425
|
* Determines wether the active element is nested within a shadowRoot
|
|
426
426
|
*/
|
|
427
427
|
|
|
428
|
-
var hasShadowRoot = function hasShadowRoot() {
|
|
429
|
-
|
|
428
|
+
var hasShadowRoot = function hasShadowRoot(node) {
|
|
429
|
+
var parent = node && node.parentNode;
|
|
430
|
+
|
|
431
|
+
while (parent) {
|
|
432
|
+
if (parent.toString() === '[object ShadowRoot]') {
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
parent = parent.parentNode;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
return false;
|
|
430
440
|
};
|
|
431
441
|
/**
|
|
432
442
|
* Get the nearest editable child and index at `index` in a `parent`, preferring
|
|
@@ -1187,7 +1197,7 @@ var ReactEditor = {
|
|
|
1187
1197
|
// (2020/08/08)
|
|
1188
1198
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=447523
|
|
1189
1199
|
|
|
1190
|
-
if (IS_CHROME && hasShadowRoot()) {
|
|
1200
|
+
if (IS_CHROME && hasShadowRoot(anchorNode)) {
|
|
1191
1201
|
isCollapsed = domRange.anchorNode === domRange.focusNode && domRange.anchorOffset === domRange.focusOffset;
|
|
1192
1202
|
} else {
|
|
1193
1203
|
isCollapsed = domRange.isCollapsed;
|