draft-js-multiline-list-item-plugin

1.0.2 • Public • Published

Draft.js MultiLine List Item plugin

This is a plugin for the draft-js-plugins-editor, a plugin system that sits on top of Draft.js.

By default DraftJS doesn't allow you to have multiline items in lists - when you press Shift+Return it still adds a new list item.

This plugin adds behaviour to the editor to stay on the same list item and include a so called 'soft newline' into the list item on Shift+Return press.

Usage

npm i --save draft-js-multiline-list-item-plugin

then import the plugin creator function

import createMultilineListItemPlugin from 'draft-js-multiline-list-item-plugin'
const multiLineListItemPlugin = createMultilineListItemPlugin()

This can then be passed into a draft-js-plugins-editor component:

import createMultilineListItemPlugin from 'draft-js-multiline-list-item-plugin'
import Editor from 'draft-js-plugins-editor'
 
const multiLineListItemPlugin = createMultilineListItemPlugin()
const plugins = [multiLineListItemPlugin]
 
<Editor plugins={plugins} />

Package Sidebar

Install

npm i draft-js-multiline-list-item-plugin

Weekly Downloads

36

Version

1.0.2

License

MIT

Unpacked Size

156 kB

Total Files

9

Last publish

Collaborators

  • andrey-semin