draft-js-checkable-list-plugin
Version:
Checkable list plugin for DraftJS
25 lines (19 loc) • 666 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _draftJsCheckableListItem = require("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 = _draftJsCheckableListItem.CheckableListItemUtils.onTab(event, editorState, config.maxDepth);
if (editorState !== newEditorState) {
setEditorState(newEditorState);
}
};
};
var _default = createOnTab;
exports.default = _default;