Skip to content

Commit ced8df5

Browse files
committed
Pass editor state getter & setter as param to keyBinding func
1 parent 66bb04b commit ced8df5

File tree

1 file changed

+2
-2
lines changed
  • draft-js-plugins-editor/src/Editor

1 file changed

+2
-2
lines changed

draft-js-plugins-editor/src/Editor/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default class PluginEditor extends Component {
123123
preventDefaultBehaviour = this.plugins
124124
.map((plugin) => {
125125
if (plugin.handleKeyCommand) {
126-
const handled = plugin.handleKeyCommand(command);
126+
const handled = plugin.handleKeyCommand(command, this.getEditorState, this.onChange);
127127
if (handled === true) {
128128
return handled;
129129
}
@@ -168,7 +168,7 @@ export default class PluginEditor extends Component {
168168
let command = this.plugins
169169
.map((plugin) => {
170170
if (plugin.keyBindingFn) {
171-
const pluginCommand = plugin.keyBindingFn(keyboardEvent);
171+
const pluginCommand = plugin.keyBindingFn(keyboardEvent, this.getEditorState, this.onChange);
172172
if (pluginCommand) {
173173
return pluginCommand;
174174
}

0 commit comments

Comments
 (0)