Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the max list depth configurable #36

Closed
wants to merge 1 commit into from
Closed

Conversation

brieb
Copy link

@brieb brieb commented Oct 6, 2017

First off, thank you for the awesome plugin! :)

In our app we want to support 7-depth lists and this plugin was forcing the limit to 4. So, we wanted to add a configuration option for setting the max list depth.

@brieb
Copy link
Author

brieb commented Oct 6, 2017

Note that if more levels of nesting are needed, the necessary CSS classes need to be provided via blockStyleFn configuration.

https://github.com/facebook/draft-js/blob/3da87b518fa090da1c30b866914fe06586bb97a2/src/component/contents/DraftEditorContents.react.js#L264-L290

facebookarchive/draft-js#997

@thibaudcolas
Copy link

Just an FYI that I had a similar use case for configurable max list depth in my own editor, so I made a little helper component that automatically generates the necessary CSS: https://github.com/thibaudcolas/draftjs-conductor.

With this added, you can configure the max depth per-editor without having to make styles "just in case" even when unnecessary. Using the helper looks like this:

import { ListNestingStyles, blockDepthStyleFn } from 'draftjs-conductor';

<Editor blockStyleFn={blockDepthStyleFn} />
<ListNestingStyles max={7} />

@brieb brieb closed this Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants