slate-angular 20.2.15 → 20.2.17
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.
|
@@ -3952,6 +3952,9 @@ class SlateEditable {
|
|
|
3952
3952
|
if (editorElement.contains(domSelection.anchorNode) && editorElement.contains(domSelection.focusNode)) {
|
|
3953
3953
|
hasDomSelectionInEditor = true;
|
|
3954
3954
|
}
|
|
3955
|
+
if (!hasDomSelectionInEditor && !AngularEditor.isFocused(this.editor)) {
|
|
3956
|
+
return;
|
|
3957
|
+
}
|
|
3955
3958
|
// If the DOM selection is in the editor and the editor selection is already correct, we're done.
|
|
3956
3959
|
if (hasDomSelection && hasDomSelectionInEditor && selection && hasStringTarget(domSelection)) {
|
|
3957
3960
|
const rangeFromDOMSelection = AngularEditor.toSlateRange(this.editor, domSelection, {
|
|
@@ -4112,6 +4115,18 @@ class SlateEditable {
|
|
|
4112
4115
|
newInViewportChildren.push(element);
|
|
4113
4116
|
}
|
|
4114
4117
|
});
|
|
4118
|
+
if (operationsOfFirstElementSplitted.length > 0) {
|
|
4119
|
+
const lastIndex = newInViewportIndics[newInViewportIndics.length - 1];
|
|
4120
|
+
for (let i = lastIndex + 1; i < this.editor.children.length; i++) {
|
|
4121
|
+
const element = this.editor.children[i];
|
|
4122
|
+
const isVisible = visibleStates[i];
|
|
4123
|
+
if (isVisible) {
|
|
4124
|
+
newInViewportIndics.push(i);
|
|
4125
|
+
newInViewportChildren.push(element);
|
|
4126
|
+
break;
|
|
4127
|
+
}
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4115
4130
|
this.inViewportIndics = newInViewportIndics;
|
|
4116
4131
|
this.inViewportChildren = newInViewportChildren;
|
|
4117
4132
|
if (isDebug) {
|