@ckeditor/ckeditor5-typing 44.2.1 → 44.3.0-alpha.0

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.js CHANGED
@@ -1201,6 +1201,17 @@ const DELETE_EVENT_TYPES = {
1201
1201
  }, {
1202
1202
  priority: 'low'
1203
1203
  });
1204
+ // Handle the Backspace key while at the beginning of a nested editable. See https://github.com/ckeditor/ckeditor5/issues/17383.
1205
+ this.listenTo(viewDocument, 'keydown', (evt, data)=>{
1206
+ if (viewDocument.isComposing || data.keyCode != keyCodes.backspace || !modelDocument.selection.isCollapsed) {
1207
+ return;
1208
+ }
1209
+ const ancestorLimit = editor.model.schema.getLimitElement(modelDocument.selection);
1210
+ const limitStartPosition = editor.model.createPositionAt(ancestorLimit, 0);
1211
+ if (limitStartPosition.isTouching(modelDocument.selection.getFirstPosition())) {
1212
+ data.preventDefault();
1213
+ }
1214
+ });
1204
1215
  if (this.editor.plugins.has('UndoEditing')) {
1205
1216
  this.listenTo(viewDocument, 'delete', (evt, data)=>{
1206
1217
  if (this._undoOnBackspace && data.direction == 'backward' && data.sequence == 1 && data.unit == 'codePoint') {