facebookarchive / draft-js

A React framework for building text editors.
https://draftjs.org/
MIT License
22.57k stars 2.63k forks source link

List item nesting not preserved on dedent #270

Open Paul-Wray opened 8 years ago

Paul-Wray commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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.