UNPKG

draft-js-checkable-list-plugin

Version:
16 lines (13 loc) 502 B
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;