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

List item nesting not preserved on dedent #270

Open
Paul-Wray opened this issue Apr 5, 2016 · 2 comments
Open

List item nesting not preserved on dedent #270

Paul-Wray opened this issue Apr 5, 2016 · 2 comments

Comments

@Paul-Wray
Copy link

During list item indenting, draft ensures correct nesting by checking that an indented item will have a parent one level lower. But when an item is dedented, its descendants stay at the same level, giving children two or more levels deeper. The descendants should also be dedented I would think.

@remko
Copy link
Contributor

remko commented Apr 5, 2016

FYI, Google Docs and OpenOffice seem to allow independent indent/dedent of items, regardless of next/previous items. So the current dedent behavior of Draft is consistent with that, but the indent behavior isn't.

@hellendag
Copy link

Yeah, this is something I remember spotting a while back.

I think Quip also allows free indenting.

I'd be fine with the Draft core also allowing this, since I don't think the framework needs to be opinionated about it.

For Draft-based editors at FB, I think we didn't want to allow arbitrary indentation. RichUtils could be the right place to do some enforcement here, since it's not required that clients use it.

facebook-github-bot pushed a commit that referenced this issue Mar 6, 2018
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants