diff --git a/lib/onTab.js b/lib/onTab.js index cd068f3..ce917c8 100644 --- a/lib/onTab.js +++ b/lib/onTab.js @@ -1,5 +1,6 @@ var Draft = require('draft-js'); var getIndentation = require('./utils/getIndentation'); +var removeIndent = require('./utils/removeIndent'); // TODO: tab should complete indentation instead of just inserting one @@ -13,6 +14,10 @@ var getIndentation = require('./utils/getIndentation'); function onTab(e, editorState) { e.preventDefault(); + if (e.shiftKey) { + return removeIndent(editorState) || editorState; + } + var contentState = editorState.getCurrentContent(); var selection = editorState.getSelection(); var startKey = selection.getStartKey();