slate-angular 13.0.1 → 13.0.4

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.
@@ -2833,13 +2833,13 @@ class SlateEditableComponent {
2833
2833
  }));
2834
2834
  }
2835
2835
  toSlateSelection() {
2836
- if (!this.readonly && !this.isComposing && !this.isUpdatingSelection && !this.isDraggingInternally) {
2836
+ if (!this.isComposing && !this.isUpdatingSelection && !this.isDraggingInternally) {
2837
2837
  try {
2838
2838
  const root = AngularEditor.findDocumentOrShadowRoot(this.editor);
2839
2839
  const { activeElement } = root;
2840
2840
  const el = AngularEditor.toDOMNode(this.editor, this.editor);
2841
2841
  const domSelection = root.getSelection();
2842
- if (activeElement === el || hasEditableTarget(this.editor, activeElement)) {
2842
+ if (activeElement === el) {
2843
2843
  this.latestElement = activeElement;
2844
2844
  IS_FOCUSED.set(this.editor, true);
2845
2845
  }
@@ -3064,7 +3064,7 @@ class SlateEditableComponent {
3064
3064
  onDOMCopy(event) {
3065
3065
  const window = AngularEditor.getWindow(this.editor);
3066
3066
  const isOutsideSlate = !hasStringTarget(window.getSelection()) && isTargetInsideVoid(this.editor, event.target);
3067
- if (!isOutsideSlate && hasTarget(this.editor, event.target) && !this.readonly && !this.isDOMEventHandled(event, this.copy)) {
3067
+ if (!isOutsideSlate && hasTarget(this.editor, event.target) && !this.isDOMEventHandled(event, this.copy)) {
3068
3068
  event.preventDefault();
3069
3069
  AngularEditor.setFragmentData(this.editor, event.clipboardData, 'copy');
3070
3070
  }
@@ -3157,8 +3157,11 @@ class SlateEditableComponent {
3157
3157
  }
3158
3158
  onDOMKeydown(event) {
3159
3159
  const editor = this.editor;
3160
+ const root = AngularEditor.findDocumentOrShadowRoot(this.editor);
3161
+ const { activeElement } = root;
3160
3162
  if (!this.readonly &&
3161
3163
  hasEditableTarget(editor, event.target) &&
3164
+ !isTargetInsideVoid(editor, activeElement) && // stop fire keydown handle when focus void node
3162
3165
  !this.isComposing &&
3163
3166
  !this.isDOMEventHandled(event, this.keydown)) {
3164
3167
  const nativeEvent = event;