@hailin-zheng/editor-core 2.0.23 → 2.0.25

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/index.js CHANGED
@@ -18036,6 +18036,11 @@ class DocumentEvent {
18036
18036
  }
18037
18037
  }
18038
18038
  onKeydown(evt) {
18039
+ const keyEvent = new KeyboradElementEvent(this.docCtx);
18040
+ keyEvent.sourceEvent = evt;
18041
+ if (DocumentEvent.invokeEvent('ElementKeyDown', this.docCtx.selectionState.startControl, keyEvent, 'All')) {
18042
+ return;
18043
+ }
18039
18044
  // const copy = () => {
18040
18045
  // const input = document.createElement('input');
18041
18046
  // document.body.appendChild(input);
@@ -18261,6 +18266,9 @@ class DocumentInput {
18261
18266
  if (DocumentEvent.invokeEvent('ElementKeyDown', this.docCtx.selectionState.startControl, keyEvent, 'All')) {
18262
18267
  return;
18263
18268
  }
18269
+ if (!this.docCtx.selectionState.editable) {
18270
+ return;
18271
+ }
18264
18272
  if (evt.keyCode === 8) {
18265
18273
  this.onBackspaceEvent.next(evt);
18266
18274
  }
@@ -28039,7 +28047,7 @@ class DocEditor {
28039
28047
  dataEle.setValue(values);
28040
28048
  editor.setDataElemEndFocus(dataEle);
28041
28049
  if (!multiSelect) {
28042
- editor.selectionState.clear();
28050
+ editor.selectionState.resetRange(dataEle.endDecorate, 1);
28043
28051
  }
28044
28052
  };
28045
28053
  const itemsVNode = options.map(item => {