Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit 73e5a9c

Browse files
ericbiewenerfacebook-github-bot
authored andcommitted
Allow indentation beyond one level deeper than block above.
Summary: **Summary** Solves #270. Removes restriction on indenting beyond one level deeper than the block above. Also allows indenting the very first item in a list. And all I had to do was delete code! ![image](https://cloud.githubusercontent.com/assets/253298/19991316/8dfb376e-a1f1-11e6-8e93-b8b49c30010b.png) **Test Plan** 1. Try indenting the first item in a list. 2. Try indenting a list item more than one level deeper than the item above it. Closes #762 Differential Revision: D7137964 fbshipit-source-id: 597732b363537e34a0f466c3188f334b3fa30a9e
1 parent 8eea2c2 commit 73e5a9c

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/model/modifier/RichTextEditorUtil.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,28 +210,11 @@ const RichTextEditorUtil = {
210210

211211
event.preventDefault();
212212

213-
// Only allow indenting one level beyond the block above, and only if
214-
// the block above is a list item as well.
215-
var blockAbove = content.getBlockBefore(key);
216-
if (!blockAbove) {
217-
return editorState;
218-
}
219-
220-
var typeAbove = blockAbove.getType();
221-
if (
222-
typeAbove !== 'unordered-list-item' &&
223-
typeAbove !== 'ordered-list-item'
224-
) {
225-
return editorState;
226-
}
227-
228213
var depth = block.getDepth();
229214
if (!event.shiftKey && depth === maxDepth) {
230215
return editorState;
231216
}
232217

233-
maxDepth = Math.min(blockAbove.getDepth() + 1, maxDepth);
234-
235218
var withAdjustment = adjustBlockDepthForContentState(
236219
content,
237220
selection,

0 commit comments

Comments
 (0)