draft-js-checkable-list-plugin
Version:
Checkable list plugin for DraftJS
16 lines (13 loc) • 502 B
JavaScript
import { CheckableListItemUtils } from 'draft-js-checkable-list-item';
var createOnTab = function createOnTab(config) {
return function (event, _ref) {
var getEditorState = _ref.getEditorState,
setEditorState = _ref.setEditorState;
var editorState = getEditorState();
var newEditorState = CheckableListItemUtils.onTab(event, editorState, config.maxDepth);
if (editorState !== newEditorState) {
setEditorState(newEditorState);
}
};
};
export default createOnTab;