draft-js-plugins-editor
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -6,2 +6,5 @@ # Change Log | ||
## 2.1.1 | ||
- Use only part of RichUtils.handleKeyCommand, since we don't want to automatically assume that code, bold, italic and the likes are included in an editor | ||
## 2.1.0 | ||
@@ -8,0 +11,0 @@ - Add defaultKeyCommands |
@@ -10,6 +10,22 @@ 'use strict'; | ||
exports.default = { | ||
// handle delete commands | ||
handleKeyCommand: function handleKeyCommand(command, editorState, _ref) { | ||
var setEditorState = _ref.setEditorState; | ||
var newState = _draftJs.RichUtils.handleKeyCommand(editorState, command); | ||
var newState = void 0; | ||
switch (command) { | ||
case 'backspace': | ||
case 'backspace-word': | ||
case 'backspace-to-start-of-line': | ||
newState = _draftJs.RichUtils.onBackspace(editorState); | ||
break; | ||
case 'delete': | ||
case 'delete-word': | ||
case 'delete-to-end-of-block': | ||
newState = _draftJs.RichUtils.onDelete(editorState); | ||
break; | ||
default: | ||
return 'not-handled'; | ||
} | ||
if (newState != null) { | ||
@@ -19,4 +35,5 @@ setEditorState(newState); | ||
} | ||
return 'not-handled'; | ||
} | ||
}; |
{ | ||
"name": "draft-js-plugins-editor", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Editor for DraftJS Plugins", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109951
31
1252